|
| 1 | +import * as reporting from "../lib/reporting"; |
| 2 | +import * as tuya from "../lib/tuya"; |
| 3 | +import type {DefinitionWithExtend} from "../lib/types"; |
| 4 | + |
| 5 | +export const definitions: DefinitionWithExtend[] = [ |
| 6 | + { |
| 7 | + fingerprint: tuya.fingerprint("TS0002", ["_TZ3210_5ksufhqi"]), |
| 8 | + model: "NFZB-2", |
| 9 | + vendor: "Nova Digital", |
| 10 | + description: "2-Gang switch with backlight, countdown and inching", |
| 11 | + extend: [ |
| 12 | + tuya.modernExtend.tuyaBase(), |
| 13 | + tuya.modernExtend.tuyaOnOff({ |
| 14 | + powerOutageMemory: true, |
| 15 | + backlightModeOffOn: true, |
| 16 | + indicatorMode: true, |
| 17 | + onOffCountdown: true, |
| 18 | + inchingSwitch: true, |
| 19 | + endpoints: ["l1", "l2"], |
| 20 | + }), |
| 21 | + tuya.clusters.addTuyaCommonPrivateCluster(), |
| 22 | + ], |
| 23 | + endpoint: () => { |
| 24 | + return {l1: 1, l2: 2}; |
| 25 | + }, |
| 26 | + meta: {multiEndpoint: true}, |
| 27 | + configure: async (device, coordinatorEndpoint) => { |
| 28 | + await tuya.configureMagicPacket(device, coordinatorEndpoint); |
| 29 | + await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ["genOnOff"]); |
| 30 | + await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ["genOnOff"]); |
| 31 | + await reporting.onOff(device.getEndpoint(1)); |
| 32 | + await reporting.onOff(device.getEndpoint(2)); |
| 33 | + }, |
| 34 | + }, |
| 35 | +]; |
0 commit comments