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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user