Skip to content

Commit 686db9b

Browse files
authored
Fix issue where invisible properties were not hidden. (#262)
1 parent 7683c4a commit 686db9b

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@
5555
}
5656
},
5757
"short_name": "Zigbee",
58-
"version": "0.15.0"
58+
"version": "0.15.1"
5959
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zigbee-adapter",
3-
"version": "0.15.0",
3+
"version": "0.15.1",
44
"description": "Zigbee adapter plugin for WebThings Gateway",
55
"author": "WebThingsIO",
66
"main": "index.js",

zb-node.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,31 +200,44 @@ class ZigbeeNode extends Device {
200200
dict.activeEndpoints = cloneDeep(this.activeEndpoints);
201201
dict.isCoordinator = this.isCoordinator;
202202
dict.rebindRequired = this.rebindRequired;
203+
203204
for (const field of DEVICE_INFO_FIELDS) {
204205
if (this.hasOwnProperty(field)) {
205206
dict[field] = this[field];
206207
}
207208
}
209+
208210
for (const endpointNum in dict.activeEndpoints) {
209211
const endpoint = dict.activeEndpoints[endpointNum];
210212
let clusterId;
211213
let idx;
212214
let zclCluster;
215+
213216
for (idx in endpoint.inputClusters) {
214217
clusterId = parseInt(endpoint.inputClusters[idx], 16);
215218
zclCluster = zclId.clusterId.get(clusterId);
219+
216220
if (zclCluster) {
217221
endpoint.inputClusters[idx] += ` - ${zclCluster.key}`;
218222
}
219223
}
224+
220225
for (idx in endpoint.outputClusters) {
221226
clusterId = parseInt(endpoint.outputClusters[idx], 16);
222227
zclCluster = zclId.clusterId.get(clusterId);
228+
223229
if (zclCluster) {
224230
endpoint.outputClusters[idx] += ` - ${zclCluster.key}`;
225231
}
226232
}
227233
}
234+
235+
for (const prop of Object.values(dict.properties)) {
236+
if (!prop.visible) {
237+
delete dict.properties[prop.name];
238+
}
239+
}
240+
228241
return dict;
229242
}
230243

0 commit comments

Comments
 (0)