Skip to content

Commit

Permalink
Add WHD02 (Koenkk#2369)
Browse files Browse the repository at this point in the history
* Tuya wall switch module with power_on_behavior option

* Update devices.js

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
  • Loading branch information
kirovilya and Koenkk authored Mar 14, 2021
1 parent de5dc90 commit f5a7fa6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,20 @@ const devices = [
},

// TuYa
{
fingerprint: [{modelID: 'TS0001', manufacturerName: '_TZ3000_hktqahrq'}],
model: 'WHD02',
vendor: 'TuYa',
description: 'Wall switch module',
toZigbee: preset.switch().toZigbee.concat([tz.moes_power_on_behavior]),
fromZigbee: preset.switch().fromZigbee.concat([fz.moes_power_on_behavior]),
exposes: preset.switch().exposes.concat([exposes.enum('power_on_behavior', ea.ALL, ['off', 'previous', 'on'])
.withDescription('Controls the behaviour when the device is powered on')]),
meta: {configureKey: 1},
configure: async (device, coordinatorEndpoint, logger) => {
await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
},
},
{
fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_mvn6jl7x'},
{modelID: 'TS011F', manufacturerName: '_TZ3000_raviyuvk'}],
Expand Down

0 comments on commit f5a7fa6

Please sign in to comment.