Skip to content

Commit

Permalink
Stop all properties being removed by default
Browse files Browse the repository at this point in the history
  • Loading branch information
benfrancis committed Apr 19, 2024
1 parent d2d2ee2 commit 191eb50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions zwave-classifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,9 @@ class ZWaveClassifier {
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/zwave-adapter/issues/140
return property;
}

Expand Down
4 changes: 3 additions & 1 deletion zwave-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ class ZWaveNode extends Device {
dict.zwClasses = this.zwClasses;
dict.zwValues = this.zwValues;

// Remove invisible properties from the Thing Description
// See https://github.com/WebThingsIO/zwave-adapter/issues/140
for (const prop of Object.values(dict.properties)) {
if (!prop.visible) {
if (prop.hasOwnProperty('visible') && prop.visible === false) {
delete dict.properties[prop.name];
}
}
Expand Down

0 comments on commit 191eb50

Please sign in to comment.