From ee9a7ab3b7a81b55d6a7b4f05b1614958743a6db Mon Sep 17 00:00:00 2001 From: Dima Gladunets <40930080+dimich99@users.noreply.github.com> Date: Thu, 6 Jul 2023 20:59:42 +0300 Subject: [PATCH] feat(add): TS0003_switch_3_gang_with_backlight (#5953) * add support for Lonsonho X703A * Update tuya.ts --------- Co-authored-by: Dmytro Hladunets Co-authored-by: Koen Kanters --- src/devices/tuya.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/devices/tuya.ts b/src/devices/tuya.ts index 8c5dd76d0f103..276c4388852f1 100644 --- a/src/devices/tuya.ts +++ b/src/devices/tuya.ts @@ -1942,6 +1942,28 @@ const definitions: Definition[] = [ tuya.whitelabel('Lonsonho', 'X702A', '2 gang switch with backlight', ['_TZ3000_54hjn4vs']), ], }, + { + fingerprint: [ + {modelID: 'TS0003', manufacturerName: '_TZ3000_rhkfbfcv'}, + ], + model: 'TS0003_switch_3_gang_with_backlight', + vendor: 'TuYa', + description: '3-Gang switch with backlight', + extend: tuya.extend.switch({powerOnBehavior2: true, indicatorMode: true, endpoints: ['l1', 'l2', 'l3']}), + endpoint: (device) => { + return {'l1': 1, 'l2': 2, 'l3': 3}; + }, + meta: {multiEndpoint: true}, + configure: async (device, coordinatorEndpoint, logger) => { + await tuya.configureMagicPacket(device, coordinatorEndpoint, logger); + await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']); + await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']); + await reporting.bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']); + }, + whiteLabel: [ + tuya.whitelabel('Lonsonho', 'X703A', '3 Gang switch with backlight', ['_TZ3000_rhkfbfcv']), + ], + }, { zigbeeModel: ['TS0002'], model: 'TS0002',