Skip to content

Commit

Permalink
feat(add): TS0726_2_gang Koenkk/zigbee2mqtt#25180
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Dec 17, 2024
1 parent 3a7c23f commit 6049904
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6681,9 +6681,33 @@ const definitions: DefinitionWithExtend[] = [
await reporting.bind(device.getEndpoint(4), coordinatorEndpoint, ['genOnOff']);
},
},
{
fingerprint: tuya.fingerprint('TS0726', ['_TZ3002_1s0vfmtv']),
model: 'TS0726_2_gang',
vendor: 'Tuya',
description: '2 gang switch with neutral wire',
fromZigbee: [fz.on_off, tuya.fz.power_on_behavior_2, fz.ignore_basic_report, fzLocal.TS0726_action],
toZigbee: [tz.on_off, tuya.tz.power_on_behavior_2, tzLocal.TS0726_switch_mode],
exposes: [
...[1, 2].map((ep) => e.switch().withEndpoint(`l${ep}`)),
...[1, 2].map((ep) => e.power_on_behavior().withEndpoint(`l${ep}`)),
...[1, 2].map((ep) => e.enum('switch_mode', ea.STATE_SET, ['switch', 'scene']).withEndpoint(`l${ep}`)),
e.action(['scene_1', 'scene_2']),
],
endpoint: (device) => {
return {l1: 1, l2: 2};
},
meta: {multiEndpoint: true},
configure: async (device, coordinatorEndpoint) => {
await tuya.configureMagicPacket(device, coordinatorEndpoint);
for (const ep of [1, 2]) {
await reporting.bind(device.getEndpoint(ep), coordinatorEndpoint, ['genOnOff']);
}
},
},
{
zigbeeModel: ['TS0726'],
model: 'TS0726',
model: 'TS0726_4_gang',
vendor: 'Tuya',
description: '4 gang switch with neutral wire',
fromZigbee: [fz.on_off, tuya.fz.power_on_behavior_2, fz.ignore_basic_report, fzLocal.TS0726_action],
Expand Down

0 comments on commit 6049904

Please sign in to comment.