Skip to content

Commit

Permalink
Make colour mode properties invisible during white mode and white mod…
Browse files Browse the repository at this point in the history
…e properties invisible during colour mode again (#31)
  • Loading branch information
bewee authored Jan 28, 2021
1 parent 07d1e99 commit d382a6e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/devices/tuya-device.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ class TuyaDevice extends Device {
this.connected = stat;
}
}

asDict() {
const dict = super.asDict();

for (const prop of Object.values(dict.properties)) {
if (!prop.visible) {
delete dict.properties[prop.name];
}
}

return dict;
}
}

module.exports = TuyaDevice;

0 comments on commit d382a6e

Please sign in to comment.