From 9132fca175550c3ed3ce87406d0ba979f06a500e Mon Sep 17 00:00:00 2001 From: nuwan-perera-au <74998748+nuwan-perera-au@users.noreply.github.com> Date: Sat, 1 Jul 2023 02:53:57 +1000 Subject: [PATCH] feat(add): SWS6TZ-WHITE (#5927) * Adding support for TZE200_8eazvzo6 * Fixed syntax error * Fixed the syntax error for datapoints * Removed trailing-spaces and tabs per Lint requirements * Fixed indentation issues * Update tuya.ts --------- Co-authored-by: Koen Kanters --- src/devices/tuya.ts | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/devices/tuya.ts b/src/devices/tuya.ts index ca4d2421c1bf3..490573ac3bb57 100644 --- a/src/devices/tuya.ts +++ b/src/devices/tuya.ts @@ -4994,6 +4994,41 @@ const definitions: Definition[] = [ ], }, }, + { + fingerprint: tuya.fingerprint('TS0601', ['_TZE200_8eazvzo6']), + model: 'SWS6TZ-WHITE', + vendor: 'TuYa', + description: '6 gang wall switch', + fromZigbee: [tuya.fz.datapoints], + toZigbee: [tuya.tz.datapoints], + configure: tuya.configureMagicPacket, + exposes: [ + e.switch().withEndpoint('l1'), + e.switch().withEndpoint('l2'), + e.switch().withEndpoint('l3'), + e.switch().withEndpoint('l4'), + e.switch().withEndpoint('l5'), + e.switch().withEndpoint('l6'), + e.current(), e.power(), e.voltage(), + ], + endpoint: (device) => { + return {'l1': 1, 'l2': 1, 'l3': 1, 'l4': 1, 'l5': 1, 'l6': 1}; + }, + meta: { + multiEndpoint: true, + tuyaDatapoints: [ + [1, 'state_l1', tuya.valueConverter.onOff], + [2, 'state_l2', tuya.valueConverter.onOff], + [3, 'state_l3', tuya.valueConverter.onOff], + [4, 'state_l4', tuya.valueConverter.onOff], + [5, 'state_l5', tuya.valueConverter.onOff], + [6, 'state_l6', tuya.valueConverter.onOff], + [21, 'current', tuya.valueConverter.divideBy1000], + [22, 'power', tuya.valueConverter.divideBy10], + [23, 'voltage', tuya.valueConverter.divideBy10], + ], + }, + }, ]; module.exports = definitions;