diff --git a/src/zb-classifier.js b/src/zb-classifier.js index 023be3c..d2d5458 100644 --- a/src/zb-classifier.js +++ b/src/zb-classifier.js @@ -1933,6 +1933,9 @@ ${(`0${d.getHours()}`).slice(-2)}:${(`0${d.getMinutes()}`).slice(-2)}:${(`0${d.g if (name[0] == '_') { property.visible = false; + // Invisible properties are no longer exposed in Thing Descriptions so + // should eventually be removed entirely. + // See https://github.com/WebThingsIO/zigbee-adapter/issues/334 } property.setInitialReadNeeded(); property.defaultValue = defaultValue; diff --git a/src/zb-node.js b/src/zb-node.js index c7e7d57..ba7ea91 100644 --- a/src/zb-node.js +++ b/src/zb-node.js @@ -236,8 +236,10 @@ class ZigbeeNode extends Device { } } + // Remove invisible properties from the Thing Description + // See https://github.com/WebThingsIO/zigbee-adapter/issues/334 for (const prop of Object.values(dict.properties)) { - if (!prop.visible) { + if (prop.hasOwnProperty('visible') && prop.visible === false) { delete dict.properties[prop.name]; } } diff --git a/src/zb-property.js b/src/zb-property.js index eebec2a..64e496f 100644 --- a/src/zb-property.js +++ b/src/zb-property.js @@ -871,7 +871,8 @@ class ZigbeeProperty extends Property { // and there is nothing that we can actually read. return; } - if (!this.visible && typeof this.value != 'undefined') { + if (this.hasOwnProperty('visible') && this.visible === false && + typeof this.value != 'undefined') { // We already know the value for this invisible property, // no need to read it again. return;