Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop all properties being removed by default #141

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading