File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -1933,6 +1933,9 @@ ${(`0${d.getHours()}`).slice(-2)}:${(`0${d.getMinutes()}`).slice(-2)}:${(`0${d.g
19331933
19341934 if ( name [ 0 ] == '_' ) {
19351935 property . visible = false ;
1936+ // Invisible properties are no longer exposed in Thing Descriptions so
1937+ // should eventually be removed entirely.
1938+ // See https://github.com/WebThingsIO/zigbee-adapter/issues/334
19361939 }
19371940 property . setInitialReadNeeded ( ) ;
19381941 property . defaultValue = defaultValue ;
Original file line number Diff line number Diff line change @@ -236,8 +236,10 @@ class ZigbeeNode extends Device {
236236 }
237237 }
238238
239+ // Remove invisible properties from the Thing Description
240+ // See https://github.com/WebThingsIO/zigbee-adapter/issues/334
239241 for ( const prop of Object . values ( dict . properties ) ) {
240- if ( ! prop . visible ) {
242+ if ( prop . hasOwnProperty ( ' visible' ) && prop . visible === false ) {
241243 delete dict . properties [ prop . name ] ;
242244 }
243245 }
Original file line number Diff line number Diff line change @@ -871,7 +871,11 @@ class ZigbeeProperty extends Property {
871871 // and there is nothing that we can actually read.
872872 return ;
873873 }
874- if ( ! this . visible && typeof this . value != 'undefined' ) {
874+ if (
875+ this . hasOwnProperty ( 'visible' ) &&
876+ this . visible === false &&
877+ typeof this . value != 'undefined'
878+ ) {
875879 // We already know the value for this invisible property,
876880 // no need to read it again.
877881 return ;
You can’t perform that action at this time.
0 commit comments