zigbee-herdsman-converters 23.33.0 → 23.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/devices/adurosmart.d.ts.map +1 -1
  3. package/dist/devices/adurosmart.js +28 -0
  4. package/dist/devices/adurosmart.js.map +1 -1
  5. package/dist/devices/amina.d.ts.map +1 -1
  6. package/dist/devices/amina.js +2 -3
  7. package/dist/devices/amina.js.map +1 -1
  8. package/dist/devices/bacchus.js.map +1 -1
  9. package/dist/devices/efekta.d.ts.map +1 -1
  10. package/dist/devices/efekta.js +51 -0
  11. package/dist/devices/efekta.js.map +1 -1
  12. package/dist/devices/gewiss.d.ts.map +1 -1
  13. package/dist/devices/gewiss.js +33 -0
  14. package/dist/devices/gewiss.js.map +1 -1
  15. package/dist/devices/index.d.ts.map +1 -1
  16. package/dist/devices/index.js +2 -0
  17. package/dist/devices/index.js.map +1 -1
  18. package/dist/devices/innr.d.ts.map +1 -1
  19. package/dist/devices/innr.js +7 -0
  20. package/dist/devices/innr.js.map +1 -1
  21. package/dist/devices/lincukoo.d.ts.map +1 -1
  22. package/dist/devices/lincukoo.js.map +1 -1
  23. package/dist/devices/mazda.d.ts.map +1 -1
  24. package/dist/devices/mazda.js.map +1 -1
  25. package/dist/devices/mindy.d.ts +1 -1
  26. package/dist/devices/mindy.d.ts.map +1 -1
  27. package/dist/devices/mindy.js.map +1 -1
  28. package/dist/devices/moes.d.ts.map +1 -1
  29. package/dist/devices/moes.js.map +1 -1
  30. package/dist/devices/nodon.d.ts.map +1 -1
  31. package/dist/devices/philips.d.ts.map +1 -1
  32. package/dist/devices/philips.js +14 -7
  33. package/dist/devices/philips.js.map +1 -1
  34. package/dist/devices/pushok.d.ts.map +1 -1
  35. package/dist/devices/pushok.js +31 -0
  36. package/dist/devices/pushok.js.map +1 -1
  37. package/dist/devices/slacky_diy.d.ts.map +1 -1
  38. package/dist/devices/slacky_diy.js.map +1 -1
  39. package/dist/devices/sonoff.d.ts.map +1 -1
  40. package/dist/devices/sonoff.js +1 -3
  41. package/dist/devices/sonoff.js.map +1 -1
  42. package/dist/devices/superled.d.ts +3 -0
  43. package/dist/devices/superled.d.ts.map +1 -0
  44. package/dist/devices/superled.js +47 -0
  45. package/dist/devices/superled.js.map +1 -0
  46. package/dist/devices/third_reality.d.ts.map +1 -1
  47. package/dist/devices/third_reality.js +1 -0
  48. package/dist/devices/third_reality.js.map +1 -1
  49. package/dist/devices/tuya.d.ts.map +1 -1
  50. package/dist/devices/tuya.js +58 -1
  51. package/dist/devices/tuya.js.map +1 -1
  52. package/dist/lib/adurosmart.d.ts +15 -0
  53. package/dist/lib/adurosmart.d.ts.map +1 -0
  54. package/dist/lib/adurosmart.js +669 -0
  55. package/dist/lib/adurosmart.js.map +1 -0
  56. package/dist/lib/color.d.ts.map +1 -1
  57. package/dist/lib/color.js +2 -2
  58. package/dist/lib/color.js.map +1 -1
  59. package/dist/lib/exposes.d.ts +16 -8
  60. package/dist/lib/exposes.d.ts.map +1 -1
  61. package/dist/lib/exposes.js +12 -24
  62. package/dist/lib/exposes.js.map +1 -1
  63. package/dist/lib/modernExtend.d.ts +1 -1
  64. package/dist/lib/modernExtend.d.ts.map +1 -1
  65. package/dist/lib/modernExtend.js +2 -8
  66. package/dist/lib/modernExtend.js.map +1 -1
  67. package/dist/lib/sunricher.d.ts.map +1 -1
  68. package/dist/models-index.json +1 -1
  69. package/package.json +3 -3
@@ -0,0 +1,15 @@
1
+ import type { ModernExtend } from "./types";
2
+ declare const extend: {
3
+ dimmerLoadControlMode: () => ModernExtend;
4
+ dimmerSwitchMode: () => ModernExtend;
5
+ dimmerInvertSwitch: () => ModernExtend;
6
+ dimmerSceneActivation: () => ModernExtend;
7
+ dimmerS1DoubleClickScene: () => ModernExtend;
8
+ dimmerS2DoubleClickScene: () => ModernExtend;
9
+ dimmerMinBrightnessLevel: () => ModernExtend;
10
+ dimmerMaxBrightnessLevel: () => ModernExtend;
11
+ dimmerManualDimmingStepSize: () => ModernExtend;
12
+ dimmerManualDimmingTime: () => ModernExtend;
13
+ };
14
+ export { extend };
15
+ //# sourceMappingURL=adurosmart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adurosmart.d.ts","sourceRoot":"","sources":["../../src/lib/adurosmart.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAwB,YAAY,EAAK,MAAM,SAAS,CAAC;AAMrE,QAAA,MAAM,MAAM;iCACmB,YAAY;4BAoEjB,YAAY;8BAsEV,YAAY;iCA+DT,YAAY;oCA+DT,YAAY;oCAqFZ,YAAY;oCAqFZ,YAAY;oCA4DZ,YAAY;uCA4DT,YAAY;mCA4DhB,YAAY;CA4D5C,CAAC;AAEF,OAAO,EAAC,MAAM,EAAC,CAAC"}
@@ -0,0 +1,669 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.extend = void 0;
37
+ const exposes = __importStar(require("./exposes"));
38
+ const utils = __importStar(require("./utils"));
39
+ const e = exposes.presets;
40
+ const ea = exposes.access;
41
+ const extend = {
42
+ dimmerLoadControlMode: () => {
43
+ const attribute = 0x7600;
44
+ const data_type = 0x20;
45
+ const value_map = {
46
+ 0: "leading_edge_control",
47
+ 1: "trailing_edge_control",
48
+ };
49
+ const value_lookup = {
50
+ leading_edge_control: 0,
51
+ trailing_edge_control: 1,
52
+ };
53
+ const fromZigbee = [
54
+ {
55
+ cluster: "genBasic",
56
+ type: ["attributeReport", "readResponse"],
57
+ convert: (model, msg, publish, options, meta) => {
58
+ if (Object.prototype.hasOwnProperty.call(msg.data, attribute)) {
59
+ const value = msg.data[attribute];
60
+ return {
61
+ dimmer_load_control_mode: value_map[value] || "unknown",
62
+ dimmer_load_control_mode_numeric: value,
63
+ };
64
+ }
65
+ return undefined;
66
+ },
67
+ },
68
+ ];
69
+ const toZigbee = [
70
+ {
71
+ key: ["dimmer_load_control_mode"],
72
+ convertSet: async (entity, key, value, meta) => {
73
+ utils.assertString(value);
74
+ const numericValue = value_lookup[value] ?? Number.parseInt(value, 10);
75
+ await entity.write("genBasic", { [attribute]: { value: numericValue, type: data_type } });
76
+ return { state: { dimmer_load_control_mode: value } };
77
+ },
78
+ convertGet: async (entity, key, meta) => {
79
+ await entity.read("genBasic", [attribute]);
80
+ },
81
+ },
82
+ ];
83
+ const exposes = [
84
+ e.enum("dimmer_load_control_mode", ea.ALL, ["leading_edge_control", "trailing_edge_control"]).withLabel("Load Control Mode"),
85
+ ];
86
+ const configure = [
87
+ async (device, coordinatorEndpoint, definition) => {
88
+ const endpoint = device.getEndpoint(1);
89
+ try {
90
+ await endpoint.read("genBasic", [attribute]);
91
+ }
92
+ catch (error) {
93
+ console.warn(`Failed to read dimmer load control mode attribute: ${error}`);
94
+ }
95
+ },
96
+ ];
97
+ return {
98
+ fromZigbee,
99
+ toZigbee,
100
+ exposes,
101
+ configure,
102
+ isModernExtend: true,
103
+ };
104
+ },
105
+ dimmerSwitchMode: () => {
106
+ const attribute = 0x7700;
107
+ const data_type = 0x20;
108
+ const value_map = {
109
+ 0: "momentary_switch",
110
+ 1: "toggle_switch",
111
+ 2: "roller_blind_switch",
112
+ };
113
+ const value_lookup = {
114
+ momentary_switch: 0,
115
+ toggle_switch: 1,
116
+ roller_blind_switch: 2,
117
+ };
118
+ const fromZigbee = [
119
+ {
120
+ cluster: "genBasic",
121
+ type: ["attributeReport", "readResponse"],
122
+ convert: (model, msg, publish, options, meta) => {
123
+ if (Object.prototype.hasOwnProperty.call(msg.data, attribute)) {
124
+ const value = msg.data[attribute];
125
+ return {
126
+ dimmer_switch_mode: value_map[value] || "unknown",
127
+ dimmer_switch_mode_numeric: value,
128
+ };
129
+ }
130
+ return undefined;
131
+ },
132
+ },
133
+ ];
134
+ const toZigbee = [
135
+ {
136
+ key: ["dimmer_switch_mode"],
137
+ convertSet: async (entity, key, value, meta) => {
138
+ utils.assertString(value);
139
+ const numericValue = value_lookup[value] ?? Number.parseInt(value, 10);
140
+ await entity.write("genBasic", { [attribute]: { value: numericValue, type: data_type } });
141
+ return { state: { dimmer_switch_mode: value } };
142
+ },
143
+ convertGet: async (entity, key, meta) => {
144
+ await entity.read("genBasic", [attribute]);
145
+ },
146
+ },
147
+ ];
148
+ const exposes = [
149
+ e.enum("dimmer_switch_mode", ea.ALL, ["momentary_switch", "toggle_switch", "roller_blind_switch"]).withLabel("Switch Mode"),
150
+ ];
151
+ const configure = [
152
+ async (device, coordinatorEndpoint, definition) => {
153
+ const endpoint = device.getEndpoint(1);
154
+ try {
155
+ await endpoint.read("genBasic", [attribute]);
156
+ }
157
+ catch (error) {
158
+ console.warn(`Failed to read dimmer switch mode attribute: ${error}`);
159
+ }
160
+ },
161
+ ];
162
+ return {
163
+ fromZigbee,
164
+ toZigbee,
165
+ exposes,
166
+ configure,
167
+ isModernExtend: true,
168
+ };
169
+ },
170
+ dimmerInvertSwitch: () => {
171
+ const attribute = 0x7701;
172
+ const data_type = 0x10;
173
+ const value_map = {
174
+ 0: "disabled",
175
+ 1: "enabled",
176
+ };
177
+ const value_lookup = {
178
+ disabled: 0,
179
+ enabled: 1,
180
+ };
181
+ const fromZigbee = [
182
+ {
183
+ cluster: "genBasic",
184
+ type: ["attributeReport", "readResponse"],
185
+ convert: (model, msg, publish, options, meta) => {
186
+ if (Object.prototype.hasOwnProperty.call(msg.data, attribute)) {
187
+ const value = msg.data[attribute];
188
+ return {
189
+ dimmer_invert_switch: value_map[value] || "unknown",
190
+ dimmer_invert_switch_numeric: value,
191
+ };
192
+ }
193
+ return undefined;
194
+ },
195
+ },
196
+ ];
197
+ const toZigbee = [
198
+ {
199
+ key: ["dimmer_invert_switch"],
200
+ convertSet: async (entity, key, value, meta) => {
201
+ utils.assertString(value);
202
+ const numericValue = value_lookup[value] ?? Number.parseInt(value, 10);
203
+ await entity.write("genBasic", { [attribute]: { value: numericValue, type: data_type } });
204
+ return { state: { dimmer_invert_switch: value } };
205
+ },
206
+ },
207
+ ];
208
+ const exposes = [e.enum("dimmer_invert_switch", ea.STATE_SET, ["disabled", "enabled"]).withLabel("Invert Switch")];
209
+ const configure = [
210
+ async (device, coordinatorEndpoint, definition) => {
211
+ const endpoint = device.getEndpoint(1);
212
+ try {
213
+ await endpoint.read("genBasic", [attribute]);
214
+ }
215
+ catch (error) {
216
+ console.warn(`Failed to read dimmer invert switch attribute: ${error}`);
217
+ }
218
+ },
219
+ ];
220
+ return {
221
+ fromZigbee,
222
+ toZigbee,
223
+ exposes,
224
+ configure,
225
+ isModernExtend: true,
226
+ };
227
+ },
228
+ dimmerSceneActivation: () => {
229
+ const attribute = 0x7702;
230
+ const data_type = 0x10;
231
+ const value_map = {
232
+ 0: "disabled",
233
+ 1: "enabled",
234
+ };
235
+ const value_lookup = {
236
+ disabled: 0,
237
+ enabled: 1,
238
+ };
239
+ const fromZigbee = [
240
+ {
241
+ cluster: "genBasic",
242
+ type: ["attributeReport", "readResponse"],
243
+ convert: (model, msg, publish, options, meta) => {
244
+ if (Object.prototype.hasOwnProperty.call(msg.data, attribute)) {
245
+ const value = msg.data[attribute];
246
+ return {
247
+ dimmer_scene_activation: value_map[value] || "unknown",
248
+ dimmer_scene_activation_numeric: value,
249
+ };
250
+ }
251
+ return undefined;
252
+ },
253
+ },
254
+ ];
255
+ const toZigbee = [
256
+ {
257
+ key: ["dimmer_scene_activation"],
258
+ convertSet: async (entity, key, value, meta) => {
259
+ utils.assertString(value);
260
+ const numericValue = value_lookup[value] ?? Number.parseInt(value, 10);
261
+ await entity.write("genBasic", { [attribute]: { value: numericValue, type: data_type } });
262
+ return { state: { dimmer_scene_activation: value } };
263
+ },
264
+ },
265
+ ];
266
+ const exposes = [e.enum("dimmer_scene_activation", ea.STATE_SET, ["disabled", "enabled"]).withLabel("Scene Activation")];
267
+ const configure = [
268
+ async (device, coordinatorEndpoint, definition) => {
269
+ const endpoint = device.getEndpoint(1);
270
+ try {
271
+ await endpoint.read("genBasic", [attribute]);
272
+ }
273
+ catch (error) {
274
+ console.warn(`Failed to read dimmer scene activation attribute: ${error}`);
275
+ }
276
+ },
277
+ ];
278
+ return {
279
+ fromZigbee,
280
+ toZigbee,
281
+ exposes,
282
+ configure,
283
+ isModernExtend: true,
284
+ };
285
+ },
286
+ dimmerS1DoubleClickScene: () => {
287
+ const attribute = 0x7703;
288
+ const data_type = 0x20;
289
+ const value_map = {
290
+ 0: "null",
291
+ 1: "on",
292
+ 2: "off",
293
+ 3: "dimming_up",
294
+ 4: "dimming_down",
295
+ 5: "dimming_to_brightest",
296
+ 6: "dimming_to_darkest",
297
+ };
298
+ const value_lookup = {
299
+ null: 0,
300
+ on: 1,
301
+ off: 2,
302
+ dimming_up: 3,
303
+ dimming_down: 4,
304
+ dimming_to_brightest: 5,
305
+ dimming_to_darkest: 6,
306
+ };
307
+ const fromZigbee = [
308
+ {
309
+ cluster: "genBasic",
310
+ type: ["attributeReport", "readResponse"],
311
+ convert: (model, msg, publish, options, meta) => {
312
+ if (Object.prototype.hasOwnProperty.call(msg.data, attribute)) {
313
+ const value = msg.data[attribute];
314
+ return {
315
+ dimmer_s1_double_click_scene: value_map[value] || "unknown",
316
+ dimmer_s1_double_click_scene_numeric: value,
317
+ };
318
+ }
319
+ return undefined;
320
+ },
321
+ },
322
+ ];
323
+ const toZigbee = [
324
+ {
325
+ key: ["dimmer_s1_double_click_scene"],
326
+ convertSet: async (entity, key, value, meta) => {
327
+ utils.assertString(value);
328
+ const numericValue = value_lookup[value] ?? Number.parseInt(value, 10);
329
+ await entity.write("genBasic", { [attribute]: { value: numericValue, type: data_type } });
330
+ return { state: { dimmer_s1_double_click_scene: value } };
331
+ },
332
+ },
333
+ ];
334
+ const exposes = [
335
+ e
336
+ .enum("dimmer_s1_double_click_scene", ea.STATE_SET, [
337
+ "null",
338
+ "on",
339
+ "off",
340
+ "dimming_up",
341
+ "dimming_down",
342
+ "dimming_to_brightest",
343
+ "dimming_to_darkest",
344
+ ])
345
+ .withLabel("S1 Double Click Scene"),
346
+ ];
347
+ const configure = [
348
+ async (device, coordinatorEndpoint, definition) => {
349
+ const endpoint = device.getEndpoint(1);
350
+ try {
351
+ await endpoint.read("genBasic", [attribute]);
352
+ }
353
+ catch (error) {
354
+ console.warn(`Failed to read dimmer s1 double click scene attribute: ${error}`);
355
+ }
356
+ },
357
+ ];
358
+ return {
359
+ fromZigbee,
360
+ toZigbee,
361
+ exposes,
362
+ configure,
363
+ isModernExtend: true,
364
+ };
365
+ },
366
+ dimmerS2DoubleClickScene: () => {
367
+ const attribute = 0x7704;
368
+ const data_type = 0x20;
369
+ const value_map = {
370
+ 0: "null",
371
+ 1: "on",
372
+ 2: "off",
373
+ 3: "dimming_up",
374
+ 4: "dimming_down",
375
+ 5: "dimming_to_brightest",
376
+ 6: "dimming_to_darkest",
377
+ };
378
+ const value_lookup = {
379
+ null: 0,
380
+ on: 1,
381
+ off: 2,
382
+ dimming_up: 3,
383
+ dimming_down: 4,
384
+ dimming_to_brightest: 5,
385
+ dimming_to_darkest: 6,
386
+ };
387
+ const fromZigbee = [
388
+ {
389
+ cluster: "genBasic",
390
+ type: ["attributeReport", "readResponse"],
391
+ convert: (model, msg, publish, options, meta) => {
392
+ if (Object.prototype.hasOwnProperty.call(msg.data, attribute)) {
393
+ const value = msg.data[attribute];
394
+ return {
395
+ dimmer_s2_double_click_scene: value_map[value] || "unknown",
396
+ dimmer_s2_double_click_scene_numeric: value,
397
+ };
398
+ }
399
+ return undefined;
400
+ },
401
+ },
402
+ ];
403
+ const toZigbee = [
404
+ {
405
+ key: ["dimmer_s2_double_click_scene"],
406
+ convertSet: async (entity, key, value, meta) => {
407
+ utils.assertString(value);
408
+ const numericValue = value_lookup[value] ?? Number.parseInt(value, 10);
409
+ await entity.write("genBasic", { [attribute]: { value: numericValue, type: data_type } });
410
+ return { state: { dimmer_s2_double_click_scene: value } };
411
+ },
412
+ },
413
+ ];
414
+ const exposes = [
415
+ e
416
+ .enum("dimmer_s2_double_click_scene", ea.STATE_SET, [
417
+ "null",
418
+ "on",
419
+ "off",
420
+ "dimming_up",
421
+ "dimming_down",
422
+ "dimming_to_brightest",
423
+ "dimming_to_darkest",
424
+ ])
425
+ .withLabel("S2 Double Click Scene"),
426
+ ];
427
+ const configure = [
428
+ async (device, coordinatorEndpoint, definition) => {
429
+ const endpoint = device.getEndpoint(1);
430
+ try {
431
+ await endpoint.read("genBasic", [attribute]);
432
+ }
433
+ catch (error) {
434
+ console.warn(`Failed to read dimmer s2 double click scene attribute: ${error}`);
435
+ }
436
+ },
437
+ ];
438
+ return {
439
+ fromZigbee,
440
+ toZigbee,
441
+ exposes,
442
+ configure,
443
+ isModernExtend: true,
444
+ };
445
+ },
446
+ dimmerMinBrightnessLevel: () => {
447
+ const attribute = 0x7800;
448
+ const data_type = 0x20;
449
+ const fromZigbee = [
450
+ {
451
+ cluster: "genBasic",
452
+ type: ["attributeReport", "readResponse"],
453
+ convert: (model, msg, publish, options, meta) => {
454
+ if (Object.prototype.hasOwnProperty.call(msg.data, attribute)) {
455
+ const value = msg.data[attribute];
456
+ return {
457
+ dimmer_min_brightness_level_numeric: value,
458
+ };
459
+ }
460
+ return undefined;
461
+ },
462
+ },
463
+ ];
464
+ const toZigbee = [
465
+ {
466
+ key: ["dimmer_min_brightness_level"],
467
+ convertSet: async (entity, key, value, meta) => {
468
+ const numericValue = value;
469
+ await entity.write("genBasic", { [attribute]: { value: numericValue, type: data_type } });
470
+ return { state: { dimmer_min_brightness_level: value } };
471
+ },
472
+ },
473
+ ];
474
+ const exposes = [
475
+ e
476
+ .numeric("dimmer_min_brightness_level", ea.STATE_SET)
477
+ .withValueMin(1)
478
+ .withValueMax(100)
479
+ .withValueStep(1)
480
+ .withLabel("Min Brightness Level"),
481
+ ];
482
+ const configure = [
483
+ async (device, coordinatorEndpoint, definition) => {
484
+ const endpoint = device.getEndpoint(1);
485
+ try {
486
+ await endpoint.read("genBasic", [attribute]);
487
+ }
488
+ catch (error) {
489
+ console.warn(`Failed to read dimmer min brightness level attribute: ${error}`);
490
+ }
491
+ },
492
+ ];
493
+ return {
494
+ fromZigbee,
495
+ toZigbee,
496
+ exposes,
497
+ configure,
498
+ isModernExtend: true,
499
+ };
500
+ },
501
+ dimmerMaxBrightnessLevel: () => {
502
+ const attribute = 0x7801;
503
+ const data_type = 0x20;
504
+ const fromZigbee = [
505
+ {
506
+ cluster: "genBasic",
507
+ type: ["attributeReport", "readResponse"],
508
+ convert: (model, msg, publish, options, meta) => {
509
+ if (Object.prototype.hasOwnProperty.call(msg.data, attribute)) {
510
+ const value = msg.data[attribute];
511
+ return {
512
+ dimmer_max_brightness_level_numeric: value,
513
+ };
514
+ }
515
+ return undefined;
516
+ },
517
+ },
518
+ ];
519
+ const toZigbee = [
520
+ {
521
+ key: ["dimmer_max_brightness_level"],
522
+ convertSet: async (entity, key, value, meta) => {
523
+ const numericValue = value;
524
+ await entity.write("genBasic", { [attribute]: { value: numericValue, type: data_type } });
525
+ return { state: { dimmer_max_brightness_level: value } };
526
+ },
527
+ },
528
+ ];
529
+ const exposes = [
530
+ e
531
+ .numeric("dimmer_max_brightness_level", ea.STATE_SET)
532
+ .withValueMin(1)
533
+ .withValueMax(100)
534
+ .withValueStep(1)
535
+ .withLabel("Max Brightness Level"),
536
+ ];
537
+ const configure = [
538
+ async (device, coordinatorEndpoint, definition) => {
539
+ const endpoint = device.getEndpoint(1);
540
+ try {
541
+ await endpoint.read("genBasic", [attribute]);
542
+ }
543
+ catch (error) {
544
+ console.warn(`Failed to read dimmer max brightness level attribute: ${error}`);
545
+ }
546
+ },
547
+ ];
548
+ return {
549
+ fromZigbee,
550
+ toZigbee,
551
+ exposes,
552
+ configure,
553
+ isModernExtend: true,
554
+ };
555
+ },
556
+ dimmerManualDimmingStepSize: () => {
557
+ const attribute = 0x7802;
558
+ const data_type = 0x20;
559
+ const fromZigbee = [
560
+ {
561
+ cluster: "genBasic",
562
+ type: ["attributeReport", "readResponse"],
563
+ convert: (model, msg, publish, options, meta) => {
564
+ if (Object.prototype.hasOwnProperty.call(msg.data, attribute)) {
565
+ const value = msg.data[attribute];
566
+ return {
567
+ dimmer_manual_dimming_step_size_numeric: value,
568
+ };
569
+ }
570
+ return undefined;
571
+ },
572
+ },
573
+ ];
574
+ const toZigbee = [
575
+ {
576
+ key: ["dimmer_manual_dimming_step_size"],
577
+ convertSet: async (entity, key, value, meta) => {
578
+ const numericValue = value;
579
+ await entity.write("genBasic", { [attribute]: { value: numericValue, type: data_type } });
580
+ return { state: { dimmer_manual_dimming_step_size: value } };
581
+ },
582
+ },
583
+ ];
584
+ const exposes = [
585
+ e
586
+ .numeric("dimmer_manual_dimming_step_size", ea.STATE_SET)
587
+ .withValueMin(1)
588
+ .withValueMax(25)
589
+ .withValueStep(1)
590
+ .withLabel("Manual Dimming Step Size"),
591
+ ];
592
+ const configure = [
593
+ async (device, coordinatorEndpoint, definition) => {
594
+ const endpoint = device.getEndpoint(1);
595
+ try {
596
+ await endpoint.read("genBasic", [attribute]);
597
+ }
598
+ catch (error) {
599
+ console.warn(`Failed to read dimmer manual dimming step size attribute: ${error}`);
600
+ }
601
+ },
602
+ ];
603
+ return {
604
+ fromZigbee,
605
+ toZigbee,
606
+ exposes,
607
+ configure,
608
+ isModernExtend: true,
609
+ };
610
+ },
611
+ dimmerManualDimmingTime: () => {
612
+ const attribute = 0x7803;
613
+ const data_type = 0x21;
614
+ const fromZigbee = [
615
+ {
616
+ cluster: "genBasic",
617
+ type: ["attributeReport", "readResponse"],
618
+ convert: (model, msg, publish, options, meta) => {
619
+ if (Object.prototype.hasOwnProperty.call(msg.data, attribute)) {
620
+ const value = msg.data[attribute];
621
+ return {
622
+ dimmer_manual_dimming_time_numeric: value,
623
+ };
624
+ }
625
+ return undefined;
626
+ },
627
+ },
628
+ ];
629
+ const toZigbee = [
630
+ {
631
+ key: ["dimmer_manual_dimming_time"],
632
+ convertSet: async (entity, key, value, meta) => {
633
+ const numericValue = value;
634
+ await entity.write("genBasic", { [attribute]: { value: numericValue, type: data_type } });
635
+ return { state: { dimmer_manual_dimming_time: value } };
636
+ },
637
+ },
638
+ ];
639
+ const exposes = [
640
+ e
641
+ .numeric("dimmer_manual_dimming_time", ea.STATE_SET)
642
+ .withUnit("ms")
643
+ .withValueMin(100)
644
+ .withValueMax(10000)
645
+ .withValueStep(100)
646
+ .withLabel("Manual Dimming Time"),
647
+ ];
648
+ const configure = [
649
+ async (device, coordinatorEndpoint, definition) => {
650
+ const endpoint = device.getEndpoint(1);
651
+ try {
652
+ await endpoint.read("genBasic", [attribute]);
653
+ }
654
+ catch (error) {
655
+ console.warn(`Failed to read dimmer manual dimming time attribute: ${error}`);
656
+ }
657
+ },
658
+ ];
659
+ return {
660
+ fromZigbee,
661
+ toZigbee,
662
+ exposes,
663
+ configure,
664
+ isModernExtend: true,
665
+ };
666
+ },
667
+ };
668
+ exports.extend = extend;
669
+ //# sourceMappingURL=adurosmart.js.map