fix(zigbee): default IEEE/Vendor/Model/LQI props to hidden, preserve user visibility

- New zigbee props (approve + first-time re-import) ship with visible=false
  so the canvas card stays clean. User opts in from the right panel.
- On re-import of an already-approved node, merge instead of overwrite:
  keys already present keep their visible flag (and any user-edited value
  is replaced with the freshly imported one), brand-new keys are appended
  hidden. Non-zigbee custom properties are preserved untouched.
This commit is contained in:
Pouzor
2026-05-14 01:10:45 +02:00
parent 5822a1483a
commit 5f87c64dcf
4 changed files with 98 additions and 11 deletions
+4 -4
View File
@@ -15,9 +15,9 @@ export function buildZigbeeProperties(input: {
lqi?: number | null
}): NodeProperty[] {
const props: NodeProperty[] = []
if (input.ieee_address) props.push({ key: 'IEEE', value: input.ieee_address, icon: null, visible: true })
if (input.vendor) props.push({ key: 'Vendor', value: input.vendor, icon: null, visible: true })
if (input.model) props.push({ key: 'Model', value: input.model, icon: null, visible: true })
if (input.lqi != null) props.push({ key: 'LQI', value: String(input.lqi), icon: null, visible: true })
if (input.ieee_address) props.push({ key: 'IEEE', value: input.ieee_address, icon: null, visible: false })
if (input.vendor) props.push({ key: 'Vendor', value: input.vendor, icon: null, visible: false })
if (input.model) props.push({ key: 'Model', value: input.model, icon: null, visible: false })
if (input.lqi != null) props.push({ key: 'LQI', value: String(input.lqi), icon: null, visible: false })
return props
}