Skip to content

Commit 903b061

Browse files
committed
Add Nova Digital NFZB-2 support
1 parent f478b1d commit 903b061

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

src/devices/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ import {definitions as nodieby} from "./nodieby";
230230
import {definitions as nodon} from "./nodon";
231231
import {definitions as nordtronic} from "./nordtronic";
232232
import {definitions as nous} from "./nous";
233+
import {definitions as novaDigital} from "./nova_digital";
233234
import {definitions as novo} from "./novo";
234235
import {definitions as nue3a} from "./nue_3a";
235236
import {definitions as nyce} from "./nyce";
@@ -606,6 +607,7 @@ const definitions: DefinitionWithExtend[] = [
606607
...nordtronic,
607608
...nous,
608609
...nobo,
610+
...novaDigital,
609611
...novo,
610612
...nue3a,
611613
...nyce,

src/devices/nova_digital.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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

Comments
 (0)