@deconz-community/ddf-validator 2.1.0 → 2.2.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.
@@ -27,7 +27,7 @@ export type DDF = {
27
27
  status: "Draft" | "Bronze" | "Silver" | "Gold";
28
28
  /** Devices section. */
29
29
  subdevices: {
30
- type: ("$TYPE_AIR_PURIFIER" | "$TYPE_AIR_QUALITY_SENSOR" | "$TYPE_ALARM_SENSOR" | "$TYPE_ANCILLARY_CONTROL" | "$TYPE_BATTERY_SENSOR" | "$TYPE_CARBON_MONOXIDE" | "$TYPE_COLOR_DIMMABLE_LIGHT" | "$TYPE_COLOR_LIGHT" | "$TYPE_COLOR_TEMPERATURE_LIGHT" | "$TYPE_CONSUMPTION_SENSOR" | "$TYPE_DIMMABLE_LIGHT" | "$TYPE_DIMMABLE_PLUGIN_UNIT" | "$TYPE_DIMMER_SWITCH" | "$TYPE_DOOR_LOCK_CONTROLLER" | "$TYPE_DOOR_LOCK" | "$TYPE_EXTENDED_COLOR_LIGHT" | "$TYPE_FIRE_SENSOR" | "$TYPE_HUMIDITY_SENSOR" | "$TYPE_LIGHT_LEVEL_SENSOR" | "$TYPE_ON_OFF_LIGHT" | "$TYPE_ON_OFF_OUTPUT" | "$TYPE_ON_OFF_PLUGIN_UNIT" | "$TYPE_OPEN_CLOSE_SENSOR" | "$TYPE_POWER_SENSOR" | "$TYPE_PRESENCE_SENSOR" | "$TYPE_PRESSURE_SENSOR" | "$TYPE_RANGE_EXTENDER" | "$TYPE_RELATIVE_ROTARY" | "$TYPE_SMART_PLUG" | "$TYPE_SPECTRAL_SENSOR" | "$TYPE_SWITCH" | "$TYPE_TEMPERATURE_SENSOR" | "$TYPE_THERMOSTAT" | "$TYPE_TIME" | "$TYPE_VIBRATION_SENSOR" | "$TYPE_WARNING_DEVICE" | "$TYPE_WATER_LEAK_SENSOR" | "$TYPE_WINDOW_COVERING_DEVICE" | "$TYPE_ZGP_SWITCH") | string;
30
+ type: ("$TYPE_AIR_PURIFIER" | "$TYPE_AIR_QUALITY_SENSOR" | "$TYPE_ALARM_SENSOR" | "$TYPE_BATTERY_SENSOR" | "$TYPE_COLOR_DIMMABLE_LIGHT" | "$TYPE_COLOR_LIGHT" | "$TYPE_COLOR_TEMPERATURE_LIGHT" | "$TYPE_CONSUMPTION_SENSOR" | "$TYPE_DIMMABLE_LIGHT" | "$TYPE_DIMMABLE_PLUGIN_UNIT" | "$TYPE_DIMMER_SWITCH" | "$TYPE_DOOR_LOCK_CONTROLLER" | "$TYPE_DOOR_LOCK" | "$TYPE_EXTENDED_COLOR_LIGHT" | "$TYPE_FIRE_SENSOR" | "$TYPE_HUMIDITY_SENSOR" | "$TYPE_LIGHT_LEVEL_SENSOR" | "$TYPE_MOISTURE_SENSOR" | "$TYPE_ON_OFF_LIGHT" | "$TYPE_ON_OFF_OUTPUT" | "$TYPE_ON_OFF_PLUGIN_UNIT" | "$TYPE_OPEN_CLOSE_SENSOR" | "$TYPE_POWER_SENSOR" | "$TYPE_PRESENCE_SENSOR" | "$TYPE_PRESSURE_SENSOR" | "$TYPE_RANGE_EXTENDER" | "$TYPE_RELATIVE_ROTARY" | "$TYPE_SMART_PLUG" | "$TYPE_SPECTRAL_SENSOR" | "$TYPE_SWITCH" | "$TYPE_TEMPERATURE_SENSOR" | "$TYPE_THERMOSTAT" | "$TYPE_VIBRATION_SENSOR" | "$TYPE_WARNING_DEVICE" | "$TYPE_WATER_LEAK_SENSOR" | "$TYPE_WINDOW_COVERING_DEVICE" | "$TYPE_ZGP_SWITCH") | string;
31
31
  restapi: "/lights" | "/sensors";
32
32
  uuid: [
33
33
  "$address.ext",
@@ -51,13 +51,24 @@ export type DDF = {
51
51
  buttons?: any | undefined;
52
52
  buttonevents?: any | undefined;
53
53
  items: {
54
- /** Item name. */
55
- name: "state/windowopen" | "state/water" | "state/voltage" | "state/vibrationstrength" | "state/vibration" | "state/valve" | "state/utc" | "state/tiltangle" | "state/tilt" | "state/test" | "state/temperature" | "state/tampered" | "state/speed" | "state/seconds_remaining" | "state/sat" | "state/rotaryevent" | "state/replacefilter" | "state/reachable" | "state/production" | "state/pressure" | "state/presenceevent" | "state/presence" | "state/power" | "state/pm2_5" | "state/panel" | "state/orientation_z" | "state/orientation_y" | "state/orientation_x" | "state/orientation" | "state/open" | "state/on" | "state/mountingmodeactive" | "state/lux" | "state/lowbattery" | "state/lockstate" | "state/localtime" | "state/lightlevel" | "state/lift" | "state/lastupdated" | "state/lastset" | "state/lastcheckin" | "state/humidity" | "state/hue" | "state/heating" | "state/gradient" | "state/gesture" | "state/fire" | "state/filterruntime" | "state/expectedrotation" | "state/expectedeventduration" | "state/eventduration" | "state/errorcode" | "state/effect" | "state/deviceruntime" | "state/daylight" | "state/dark" | "state/current" | "state/current_P3" | "state/current_P2" | "state/current_P1" | "state/ct" | "state/consumption" | "state/consumption_2" | "state/y" | "state/x" | "state/colormode" | "state/charging" | "state/carbonmonoxide" | "state/buttonevent" | "state/bri" | "state/battery" | "state/angle" | "state/alert" | "state/alarm" | "state/airqualityppb" | "state/airquality" | "state/action" | "config/windowopen_set" | "config/windowcoveringtype" | "config/usertest" | "config/unoccupiedheatsetpoint" | "config/triggerdistance" | "config/tholdoffset" | "config/tholddark" | "config/temperature" | "config/swingmode" | "config/sensitivitymax" | "config/sensitivity" | "config/selftest" | "config/schedule_on" | "config/schedule" | "config/resetpresence" | "config/reachable" | "config/pulseconfiguration" | "config/preset" | "config/pending" | "config/on/startup" | "config/on" | "config/offset" | "config/mountingmode" | "config/mode" | "config/locked" | "config/lock" | "config/ledindication" | "config/interfacemode" | "config/heatsetpoint" | "config/group" | "config/filterlifetime" | "config/fanmode" | "config/externalwindowopen" | "config/externalsensortemp" | "config/enrolled" | "config/duration" | "config/displayflipped" | "config/devicemode" | "config/delay" | "config/ctmin" | "config/ctmax" | "config/coolsetpoint" | "config/controlsequence" | "config/configured" | "config/colorcapabilities" | "config/color/xy/startup_y" | "config/color/xy/startup_x" | "config/color/gradient/reversed" | "config/color/execute_if_off" | "config/color/ct/startup" | "config/clickmode" | "config/checkin" | "config/bri/startup" | "config/bri/onoff_transitiontime" | "config/bri/on_level" | "config/bri/min" | "config/bri/max" | "config/bri/execute_if_off" | "config/battery" | "config/allowtouchlink" | "config/alert" | "cap/transition_block" | "cap/sleeper" | "cap/on/off_with_effect" | "cap/groups/not_supported" | "cap/color/xy/red_y" | "cap/color/xy/red_x" | "cap/color/xy/green_y" | "cap/color/xy/green_x" | "cap/color/xy/blue_y" | "cap/color/xy/blue_x" | "cap/color/gradient/styles" | "cap/color/gradient/pixel_length" | "cap/color/gradient/pixel_count" | "cap/color/gradient/max_segments" | "cap/color/gamut_type" | "cap/color/effects" | "cap/color/ct/min" | "cap/color/ct/max" | "cap/color/ct/computes_xy" | "cap/color/capabilities" | "cap/bri/move_with_onoff" | "cap/bri/min_dim_level" | "cap/alert/trigger_effect" | "attr/uniqueid" | "attr/type" | "attr/swversion" | "attr/swconfigid" | "attr/productname" | "attr/productid" | "attr/powerup" | "attr/poweronlevel" | "attr/poweronct" | "attr/name" | "attr/modelid" | "attr/mode" | "attr/manufacturername" | "attr/lastseen" | "attr/lastannounced" | "attr/id";
56
54
  /** Item description, better to do not use it. */
57
55
  description?: string | undefined;
56
+ /** TODO: What is this ? What the difference with description ? */
58
57
  comment?: string | undefined;
58
+ /** Date of deprecation, if the item is deprecated, it's better to use the new one. */
59
+ deprecated?: string | undefined;
60
+ /** Data type of the item. */
61
+ datatype?: ("String" | "Bool" | "Int8" | "Int16" | "Int32" | "Int64" | "UInt8" | "UInt16" | "UInt32" | "UInt64" | "Array" | "Array[3]" | "ISO 8601 timestamp") | undefined;
62
+ /** Access mode for this item, some of them are not editable. */
63
+ access?: ("R" | "W" | "RW") | undefined;
59
64
  /** Item visible on the API. */
60
65
  public?: boolean | undefined;
66
+ /** TODO: What is this ? */
67
+ implicit?: boolean | undefined;
68
+ /** TODO: What is this ? */
69
+ managed?: boolean | undefined;
70
+ /** The device is considered awake when this item is set due a incoming command. */
71
+ awake?: boolean | undefined;
61
72
  /** A static default value is fixed and can be not changed. */
62
73
  static?: (string | number | boolean) | undefined;
63
74
  /** Values range limit. */
@@ -65,9 +76,8 @@ export type DDF = {
65
76
  number,
66
77
  number
67
78
  ] | undefined;
68
- deprecated?: string | undefined;
69
- /** Access mode for this item, some of them are not editable. */
70
- access?: "R" | undefined;
79
+ /** TODO: What is this ? */
80
+ virtual?: boolean | undefined;
71
81
  /** Fonction used to read value. */
72
82
  read?: ({
73
83
  fn: "none";
@@ -97,6 +107,38 @@ export type DDF = {
97
107
  mf?: string | undefined;
98
108
  /** Javascript expression to transform the raw value. */
99
109
  eval?: string | undefined;
110
+ /** Relative path of a Javascript .js file. */
111
+ script?: string | undefined;
112
+ } | {
113
+ /** Generic function to parse ZCL values from read/report commands. */
114
+ fn: "zcl:attr";
115
+ /** String hex value or array of string hex values. */
116
+ at: string | string[];
117
+ /** Cluster ID. */
118
+ cl: string;
119
+ /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
120
+ ep?: (string | number) | undefined;
121
+ /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
122
+ mf?: string | undefined;
123
+ /** Javascript expression to transform the attribute value to the Item value. */
124
+ eval?: string | undefined;
125
+ /** Relative path of a Javascript .js file. */
126
+ script?: string | undefined;
127
+ } | {
128
+ /** Generic function to parse ZCL values from read/report commands. */
129
+ fn: "zcl:cmd";
130
+ /** Cluster ID. */
131
+ cl: string;
132
+ /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
133
+ ep?: (string | number) | undefined;
134
+ /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
135
+ mf?: string | undefined;
136
+ /** Zigbee command. */
137
+ cmd?: string | undefined;
138
+ /** Javascript expression to transform the attribute value to the Item value. */
139
+ eval?: string | undefined;
140
+ /** Relative path of a Javascript .js file. */
141
+ script?: string | undefined;
100
142
  } | {
101
143
  /** Generic function to read all Tuya datapoints. It has no parameters. */
102
144
  fn: "tuya";
@@ -106,7 +148,7 @@ export type DDF = {
106
148
  /** Generic function to parse ZCL attributes and commands. */
107
149
  fn?: undefined;
108
150
  /** Attribute ID. */
109
- at?: string | undefined;
151
+ at?: (string | string[]) | undefined;
110
152
  /** Cluster ID. */
111
153
  cl: string;
112
154
  cppsrc?: string | undefined;
@@ -124,7 +166,7 @@ export type DDF = {
124
166
  /** Generic function to parse ZCL attributes and commands. */
125
167
  fn: "zcl";
126
168
  /** Attribute ID. */
127
- at?: string | undefined;
169
+ at?: (string | string[]) | undefined;
128
170
  /** Cluster ID. */
129
171
  cl: string;
130
172
  cppsrc?: string | undefined;
@@ -138,6 +180,36 @@ export type DDF = {
138
180
  eval?: string | undefined;
139
181
  /** Relative path of a Javascript .js file. */
140
182
  script?: string | undefined;
183
+ } | {
184
+ /** Generic function to parse ZCL values from read/report commands. */
185
+ fn: "zcl:attr";
186
+ /** String hex value or array of string hex values. */
187
+ at: string | string[];
188
+ /** Cluster ID. */
189
+ cl: string;
190
+ /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
191
+ ep?: (string | number) | undefined;
192
+ /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
193
+ mf?: string | undefined;
194
+ /** Javascript expression to transform the attribute value to the Item value. */
195
+ eval?: string | undefined;
196
+ /** Relative path of a Javascript .js file. */
197
+ script?: string | undefined;
198
+ } | {
199
+ /** Generic function to parse ZCL values from read/report commands. */
200
+ fn: "zcl:cmd";
201
+ /** Cluster ID. */
202
+ cl: string;
203
+ /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
204
+ ep?: (string | number) | undefined;
205
+ /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
206
+ mf?: string | undefined;
207
+ /** Zigbee command. */
208
+ cmd?: string | undefined;
209
+ /** Javascript expression to transform the attribute value to the Item value. */
210
+ eval?: string | undefined;
211
+ /** Relative path of a Javascript .js file. */
212
+ script?: string | undefined;
141
213
  } | {
142
214
  /** Generic function to parse IAS ZONE status change notifications or zone status from read/report command. */
143
215
  fn: "ias:zonestatus";
@@ -217,6 +289,42 @@ export type DDF = {
217
289
  eval?: string | undefined;
218
290
  /** Relative path of a Javascript .js file. */
219
291
  script?: string | undefined;
292
+ } | {
293
+ /** Generic function to parse ZCL values from read/report commands. */
294
+ fn: "zcl:attr";
295
+ /** String hex value or array of string hex values. */
296
+ at: string | string[];
297
+ "state.timeout"?: number | undefined;
298
+ "change.timeout"?: number | undefined;
299
+ /** Cluster ID. */
300
+ cl: string;
301
+ /** Data type. */
302
+ dt: string;
303
+ /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
304
+ ep?: (string | number) | undefined;
305
+ /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
306
+ mf?: string | undefined;
307
+ /** Javascript expression to transform the attribute value to the Item value. */
308
+ eval?: string | undefined;
309
+ /** Relative path of a Javascript .js file. */
310
+ script?: string | undefined;
311
+ } | {
312
+ /** Generic function to parse ZCL values from read/report commands. */
313
+ fn: "zcl:cmd";
314
+ /** Cluster ID. */
315
+ cl: string;
316
+ /** Data type. */
317
+ dt: string;
318
+ /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
319
+ ep?: (string | number) | undefined;
320
+ /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
321
+ mf?: string | undefined;
322
+ /** Zigbee command. */
323
+ cmd?: string | undefined;
324
+ /** Javascript expression to transform the attribute value to the Item value. */
325
+ eval?: string | undefined;
326
+ /** Relative path of a Javascript .js file. */
327
+ script?: string | undefined;
220
328
  } | {
221
329
  /** Generic function to write Tuya data. */
222
330
  fn: "tuya";
@@ -229,13 +337,14 @@ export type DDF = {
229
337
  /** Relative path of a Javascript .js file. */
230
338
  script?: string | undefined;
231
339
  }) | undefined;
232
- /** The device is considered awake when this item is set due a incoming command. */
233
- awake?: boolean | undefined;
234
- /** Defaut value. */
235
- default?: unknown | undefined;
236
- values?: unknown | undefined;
237
340
  /** Refresh interval used for read fonction, NEED to be superior at value used in binding part. */
238
341
  "refresh.interval"?: number | undefined;
342
+ /** TODO: What is this ? */
343
+ values?: unknown | undefined;
344
+ /** Defaut value. */
345
+ default?: unknown | undefined;
346
+ /** Item name. */
347
+ name: "state/windowopen" | "state/water" | "state/voltage" | "state/vibrationstrength" | "state/vibration" | "state/valve" | "state/utc" | "state/tiltangle" | "state/tilt" | "state/test" | "state/temperature" | "state/tampered" | "state/speed" | "state/seconds_remaining" | "state/sat" | "state/rotaryevent" | "state/replacefilter" | "state/reachable" | "state/production" | "state/pressure" | "state/presenceevent" | "state/presence" | "state/power" | "state/pm2_5" | "state/panel" | "state/orientation_z" | "state/orientation_y" | "state/orientation_x" | "state/orientation" | "state/open" | "state/on" | "state/mountingmodeactive" | "state/moisture" | "state/lux" | "state/lowbattery" | "state/lockstate" | "state/localtime" | "state/lightlevel" | "state/lift" | "state/lastupdated" | "state/lastset" | "state/lastcheckin" | "state/humidity" | "state/hue" | "state/heating" | "state/gradient" | "state/gesture" | "state/fire" | "state/filterruntime" | "state/expectedrotation" | "state/expectedeventduration" | "state/eventduration" | "state/errorcode" | "state/effect" | "state/deviceruntime" | "state/daylight" | "state/dark" | "state/current" | "state/current_P3" | "state/current_P2" | "state/current_P1" | "state/ct" | "state/consumption" | "state/consumption_2" | "state/y" | "state/x" | "state/colormode" | "state/charging" | "state/carbonmonoxide" | "state/buttonevent" | "state/bri" | "state/battery" | "state/angle" | "state/alert" | "state/alarm" | "state/airqualityppb" | "state/airquality" | "state/action" | "config/windowopen_set" | "config/windowcoveringtype" | "config/volume" | "config/usertest" | "config/unoccupiedheatsetpoint" | "config/tuya_unlock" | "config/triggerdistance" | "config/tholdoffset" | "config/tholddark" | "config/temperature" | "config/swingmode" | "config/speed" | "config/sensitivitymax" | "config/sensitivity" | "config/selftest" | "config/schedule_on" | "config/schedule" | "config/reversed" | "config/resetpresence" | "config/reachable" | "config/pulseconfiguration" | "config/preset" | "config/pending" | "config/on/startup" | "config/on" | "config/offset" | "config/mountingmode" | "config/mode" | "config/melody" | "config/locked" | "config/lock" | "config/ledindication" | "config/interfacemode" | "config/heatsetpoint" | "config/group" | "config/filterlifetime" | "config/fanmode" | "config/externalwindowopen" | "config/externalsensortemp" | "config/enrolled" | "config/duration" | "config/displayflipped" | "config/devicemode" | "config/delay" | "config/ctmin" | "config/ctmax" | "config/coolsetpoint" | "config/controlsequence" | "config/configured" | "config/colorcapabilities" | "config/color/xy/startup_y" | "config/color/xy/startup_x" | "config/color/gradient/reversed" | "config/color/execute_if_off" | "config/color/ct/startup" | "config/clickmode" | "config/checkin" | "config/bri/startup" | "config/bri/onoff_transitiontime" | "config/bri/on_level" | "config/bri/min" | "config/bri/max" | "config/bri/execute_if_off" | "config/battery" | "config/allowtouchlink" | "config/alert" | "cap/transition_block" | "cap/sleeper" | "cap/on/off_with_effect" | "cap/groups/not_supported" | "cap/color/xy/red_y" | "cap/color/xy/red_x" | "cap/color/xy/green_y" | "cap/color/xy/green_x" | "cap/color/xy/blue_y" | "cap/color/xy/blue_x" | "cap/color/gradient/styles" | "cap/color/gradient/pixel_length" | "cap/color/gradient/pixel_count" | "cap/color/gradient/max_segments" | "cap/color/gamut_type" | "cap/color/effects" | "cap/color/ct/min" | "cap/color/ct/max" | "cap/color/ct/computes_xy" | "cap/color/capabilities" | "cap/bri/move_with_onoff" | "cap/bri/min_dim_level" | "cap/alert/trigger_effect" | "attr/xiaomi" | "attr/uniqueid" | "attr/type" | "attr/swversion" | "attr/swconfigid" | "attr/productname" | "attr/productid" | "attr/powerup" | "attr/poweronlevel" | "attr/poweronct" | "attr/name" | "attr/modelid" | "attr/mode" | "attr/manufacturername" | "attr/lastseen" | "attr/lastannounced" | "attr/id";
239
348
  }[];
240
349
  example?: unknown | undefined;
241
350
  }[];
@@ -277,20 +386,104 @@ export type DDF = {
277
386
  $schema?: string | undefined;
278
387
  schema: "resourceitem1.schema.json";
279
388
  id: string;
280
- description: string;
389
+ /** Item description, better to do not use it. */
390
+ description?: string | undefined;
391
+ /** TODO: What is this ? What the difference with description ? */
392
+ comment?: string | undefined;
393
+ /** Date of deprecation, if the item is deprecated, it's better to use the new one. */
281
394
  deprecated?: string | undefined;
282
- datatype: "String" | "Bool" | "Int8" | "Int16" | "Int32" | "Int64" | "UInt8" | "UInt16" | "UInt32" | "UInt64" | "Array" | "Array[3]" | "ISO 8601 timestamp";
283
- access: "R" | "W" | "RW";
284
- public: boolean;
395
+ /** Data type of the item. */
396
+ datatype?: ("String" | "Bool" | "Int8" | "Int16" | "Int32" | "Int64" | "UInt8" | "UInt16" | "UInt32" | "UInt64" | "Array" | "Array[3]" | "ISO 8601 timestamp") | undefined;
397
+ /** Access mode for this item, some of them are not editable. */
398
+ access?: ("R" | "W" | "RW") | undefined;
399
+ /** Item visible on the API. */
400
+ public?: boolean | undefined;
401
+ /** TODO: What is this ? */
285
402
  implicit?: boolean | undefined;
403
+ /** TODO: What is this ? */
286
404
  managed?: boolean | undefined;
287
- static?: boolean | undefined;
405
+ /** The device is considered awake when this item is set due a incoming command. */
406
+ awake?: boolean | undefined;
407
+ /** A static default value is fixed and can be not changed. */
408
+ static?: (string | number | boolean) | undefined;
409
+ /** Values range limit. */
410
+ range?: [
411
+ number,
412
+ number
413
+ ] | undefined;
414
+ /** TODO: What is this ? */
288
415
  virtual?: boolean | undefined;
416
+ /** Fonction used to read value. */
417
+ read?: ({
418
+ fn: "none";
419
+ } | {
420
+ /** Generic function to read ZCL attributes. */
421
+ fn?: undefined;
422
+ /** Attribute ID. */
423
+ at: string | string[];
424
+ /** Cluster ID. */
425
+ cl: string;
426
+ /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
427
+ ep?: (string | number) | undefined;
428
+ /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
429
+ mf?: string | undefined;
430
+ /** Javascript expression to transform the raw value. */
431
+ eval?: string | undefined;
432
+ } | {
433
+ /** Generic function to read ZCL attributes. */
434
+ fn: "zcl";
435
+ /** Attribute ID. */
436
+ at: string | string[];
437
+ /** Cluster ID. */
438
+ cl: string;
439
+ /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
440
+ ep?: (string | number) | undefined;
441
+ /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
442
+ mf?: string | undefined;
443
+ /** Javascript expression to transform the raw value. */
444
+ eval?: string | undefined;
445
+ /** Relative path of a Javascript .js file. */
446
+ script?: string | undefined;
447
+ } | {
448
+ /** Generic function to parse ZCL values from read/report commands. */
449
+ fn: "zcl:attr";
450
+ /** String hex value or array of string hex values. */
451
+ at: string | string[];
452
+ /** Cluster ID. */
453
+ cl: string;
454
+ /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
455
+ ep?: (string | number) | undefined;
456
+ /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
457
+ mf?: string | undefined;
458
+ /** Javascript expression to transform the attribute value to the Item value. */
459
+ eval?: string | undefined;
460
+ /** Relative path of a Javascript .js file. */
461
+ script?: string | undefined;
462
+ } | {
463
+ /** Generic function to parse ZCL values from read/report commands. */
464
+ fn: "zcl:cmd";
465
+ /** Cluster ID. */
466
+ cl: string;
467
+ /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
468
+ ep?: (string | number) | undefined;
469
+ /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
470
+ mf?: string | undefined;
471
+ /** Zigbee command. */
472
+ cmd?: string | undefined;
473
+ /** Javascript expression to transform the attribute value to the Item value. */
474
+ eval?: string | undefined;
475
+ /** Relative path of a Javascript .js file. */
476
+ script?: string | undefined;
477
+ } | {
478
+ /** Generic function to read all Tuya datapoints. It has no parameters. */
479
+ fn: "tuya";
480
+ }) | undefined;
481
+ /** Fonction used to parse incoming values. */
289
482
  parse?: ({
290
483
  /** Generic function to parse ZCL attributes and commands. */
291
484
  fn?: undefined;
292
485
  /** Attribute ID. */
293
- at?: string | undefined;
486
+ at?: (string | string[]) | undefined;
294
487
  /** Cluster ID. */
295
488
  cl: string;
296
489
  cppsrc?: string | undefined;
@@ -308,7 +501,7 @@ export type DDF = {
308
501
  /** Generic function to parse ZCL attributes and commands. */
309
502
  fn: "zcl";
310
503
  /** Attribute ID. */
311
- at?: string | undefined;
504
+ at?: (string | string[]) | undefined;
312
505
  /** Cluster ID. */
313
506
  cl: string;
314
507
  cppsrc?: string | undefined;
@@ -322,6 +515,36 @@ export type DDF = {
322
515
  eval?: string | undefined;
323
516
  /** Relative path of a Javascript .js file. */
324
517
  script?: string | undefined;
518
+ } | {
519
+ /** Generic function to parse ZCL values from read/report commands. */
520
+ fn: "zcl:attr";
521
+ /** String hex value or array of string hex values. */
522
+ at: string | string[];
523
+ /** Cluster ID. */
524
+ cl: string;
525
+ /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
526
+ ep?: (string | number) | undefined;
527
+ /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
528
+ mf?: string | undefined;
529
+ /** Javascript expression to transform the attribute value to the Item value. */
530
+ eval?: string | undefined;
531
+ /** Relative path of a Javascript .js file. */
532
+ script?: string | undefined;
533
+ } | {
534
+ /** Generic function to parse ZCL values from read/report commands. */
535
+ fn: "zcl:cmd";
536
+ /** Cluster ID. */
537
+ cl: string;
538
+ /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
539
+ ep?: (string | number) | undefined;
540
+ /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
541
+ mf?: string | undefined;
542
+ /** Zigbee command. */
543
+ cmd?: string | undefined;
544
+ /** Javascript expression to transform the attribute value to the Item value. */
545
+ eval?: string | undefined;
546
+ /** Relative path of a Javascript .js file. */
547
+ script?: string | undefined;
325
548
  } | {
326
549
  /** Generic function to parse IAS ZONE status change notifications or zone status from read/report command. */
327
550
  fn: "ias:zonestatus";
@@ -362,44 +585,50 @@ export type DDF = {
362
585
  /** Relative path of a Javascript .js file. */
363
586
  script?: string | undefined;
364
587
  }) | undefined;
365
- read?: ({
588
+ /** Fonction used to write value. */
589
+ write?: ({
366
590
  fn: "none";
367
591
  } | {
368
- /** Generic function to read ZCL attributes. */
369
592
  fn?: undefined;
370
593
  /** Attribute ID. */
371
- at: string | string[];
594
+ at?: (string | string[]) | undefined;
595
+ "state.timeout"?: number | undefined;
596
+ "change.timeout"?: number | undefined;
372
597
  /** Cluster ID. */
373
598
  cl: string;
599
+ /** Data type. */
600
+ dt: string;
374
601
  /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
375
602
  ep?: (string | number) | undefined;
376
603
  /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
377
604
  mf?: string | undefined;
378
605
  /** Javascript expression to transform the raw value. */
379
606
  eval?: string | undefined;
607
+ /** Relative path of a Javascript .js file. */
608
+ script?: string | undefined;
380
609
  } | {
381
- /** Generic function to read ZCL attributes. */
382
610
  fn: "zcl";
383
611
  /** Attribute ID. */
384
- at: string | string[];
612
+ at?: (string | string[]) | undefined;
613
+ "state.timeout"?: number | undefined;
614
+ "change.timeout"?: number | undefined;
385
615
  /** Cluster ID. */
386
616
  cl: string;
617
+ /** Data type. */
618
+ dt: string;
387
619
  /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
388
620
  ep?: (string | number) | undefined;
389
621
  /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
390
622
  mf?: string | undefined;
391
623
  /** Javascript expression to transform the raw value. */
392
624
  eval?: string | undefined;
625
+ /** Relative path of a Javascript .js file. */
626
+ script?: string | undefined;
393
627
  } | {
394
- /** Generic function to read all Tuya datapoints. It has no parameters. */
395
- fn: "tuya";
396
- }) | undefined;
397
- write?: ({
398
- fn: "none";
399
- } | {
400
- fn?: undefined;
401
- /** Attribute ID. */
402
- at?: (string | string[]) | undefined;
628
+ /** Generic function to parse ZCL values from read/report commands. */
629
+ fn: "zcl:attr";
630
+ /** String hex value or array of string hex values. */
631
+ at: string | string[];
403
632
  "state.timeout"?: number | undefined;
404
633
  "change.timeout"?: number | undefined;
405
634
  /** Cluster ID. */
@@ -410,16 +639,13 @@ export type DDF = {
410
639
  ep?: (string | number) | undefined;
411
640
  /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
412
641
  mf?: string | undefined;
413
- /** Javascript expression to transform the raw value. */
642
+ /** Javascript expression to transform the attribute value to the Item value. */
414
643
  eval?: string | undefined;
415
644
  /** Relative path of a Javascript .js file. */
416
645
  script?: string | undefined;
417
646
  } | {
418
- fn: "zcl";
419
- /** Attribute ID. */
420
- at?: (string | string[]) | undefined;
421
- "state.timeout"?: number | undefined;
422
- "change.timeout"?: number | undefined;
647
+ /** Generic function to parse ZCL values from read/report commands. */
648
+ fn: "zcl:cmd";
423
649
  /** Cluster ID. */
424
650
  cl: string;
425
651
  /** Data type. */
@@ -428,7 +654,9 @@ export type DDF = {
428
654
  ep?: (string | number) | undefined;
429
655
  /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
430
656
  mf?: string | undefined;
431
- /** Javascript expression to transform the raw value. */
657
+ /** Zigbee command. */
658
+ cmd?: string | undefined;
659
+ /** Javascript expression to transform the attribute value to the Item value. */
432
660
  eval?: string | undefined;
433
661
  /** Relative path of a Javascript .js file. */
434
662
  script?: string | undefined;
@@ -444,17 +672,16 @@ export type DDF = {
444
672
  /** Relative path of a Javascript .js file. */
445
673
  script?: string | undefined;
446
674
  }) | undefined;
675
+ /** Refresh interval used for read fonction, NEED to be superior at value used in binding part. */
447
676
  "refresh.interval"?: number | undefined;
677
+ /** TODO: What is this ? */
448
678
  values?: unknown | undefined;
449
- range?: [
450
- number,
451
- number
452
- ] | undefined;
679
+ /** Defaut value. */
453
680
  default?: unknown | undefined;
454
681
  } | {
455
682
  $schema?: string | undefined;
456
683
  schema: "subdevice1.schema.json";
457
- type: ("$TYPE_AIR_PURIFIER" | "$TYPE_AIR_QUALITY_SENSOR" | "$TYPE_ALARM_SENSOR" | "$TYPE_ANCILLARY_CONTROL" | "$TYPE_BATTERY_SENSOR" | "$TYPE_CARBON_MONOXIDE" | "$TYPE_COLOR_DIMMABLE_LIGHT" | "$TYPE_COLOR_LIGHT" | "$TYPE_COLOR_TEMPERATURE_LIGHT" | "$TYPE_CONSUMPTION_SENSOR" | "$TYPE_DIMMABLE_LIGHT" | "$TYPE_DIMMABLE_PLUGIN_UNIT" | "$TYPE_DIMMER_SWITCH" | "$TYPE_DOOR_LOCK_CONTROLLER" | "$TYPE_DOOR_LOCK" | "$TYPE_EXTENDED_COLOR_LIGHT" | "$TYPE_FIRE_SENSOR" | "$TYPE_HUMIDITY_SENSOR" | "$TYPE_LIGHT_LEVEL_SENSOR" | "$TYPE_ON_OFF_LIGHT" | "$TYPE_ON_OFF_OUTPUT" | "$TYPE_ON_OFF_PLUGIN_UNIT" | "$TYPE_OPEN_CLOSE_SENSOR" | "$TYPE_POWER_SENSOR" | "$TYPE_PRESENCE_SENSOR" | "$TYPE_PRESSURE_SENSOR" | "$TYPE_RANGE_EXTENDER" | "$TYPE_RELATIVE_ROTARY" | "$TYPE_SMART_PLUG" | "$TYPE_SPECTRAL_SENSOR" | "$TYPE_SWITCH" | "$TYPE_TEMPERATURE_SENSOR" | "$TYPE_THERMOSTAT" | "$TYPE_TIME" | "$TYPE_VIBRATION_SENSOR" | "$TYPE_WARNING_DEVICE" | "$TYPE_WATER_LEAK_SENSOR" | "$TYPE_WINDOW_COVERING_DEVICE" | "$TYPE_ZGP_SWITCH") | string;
684
+ type: ("$TYPE_AIR_PURIFIER" | "$TYPE_AIR_QUALITY_SENSOR" | "$TYPE_ALARM_SENSOR" | "$TYPE_BATTERY_SENSOR" | "$TYPE_COLOR_DIMMABLE_LIGHT" | "$TYPE_COLOR_LIGHT" | "$TYPE_COLOR_TEMPERATURE_LIGHT" | "$TYPE_CONSUMPTION_SENSOR" | "$TYPE_DIMMABLE_LIGHT" | "$TYPE_DIMMABLE_PLUGIN_UNIT" | "$TYPE_DIMMER_SWITCH" | "$TYPE_DOOR_LOCK_CONTROLLER" | "$TYPE_DOOR_LOCK" | "$TYPE_EXTENDED_COLOR_LIGHT" | "$TYPE_FIRE_SENSOR" | "$TYPE_HUMIDITY_SENSOR" | "$TYPE_LIGHT_LEVEL_SENSOR" | "$TYPE_MOISTURE_SENSOR" | "$TYPE_ON_OFF_LIGHT" | "$TYPE_ON_OFF_OUTPUT" | "$TYPE_ON_OFF_PLUGIN_UNIT" | "$TYPE_OPEN_CLOSE_SENSOR" | "$TYPE_POWER_SENSOR" | "$TYPE_PRESENCE_SENSOR" | "$TYPE_PRESSURE_SENSOR" | "$TYPE_RANGE_EXTENDER" | "$TYPE_RELATIVE_ROTARY" | "$TYPE_SMART_PLUG" | "$TYPE_SPECTRAL_SENSOR" | "$TYPE_SWITCH" | "$TYPE_TEMPERATURE_SENSOR" | "$TYPE_THERMOSTAT" | "$TYPE_VIBRATION_SENSOR" | "$TYPE_WARNING_DEVICE" | "$TYPE_WATER_LEAK_SENSOR" | "$TYPE_WINDOW_COVERING_DEVICE" | "$TYPE_ZGP_SWITCH") | string;
458
685
  name: string;
459
686
  restapi: "/lights" | "/sensors";
460
687
  order: number;
@@ -466,11 +693,15 @@ export type DDF = {
466
693
  string,
467
694
  string
468
695
  ];
469
- items: ("state/windowopen" | "state/water" | "state/voltage" | "state/vibrationstrength" | "state/vibration" | "state/valve" | "state/utc" | "state/tiltangle" | "state/tilt" | "state/test" | "state/temperature" | "state/tampered" | "state/speed" | "state/seconds_remaining" | "state/sat" | "state/rotaryevent" | "state/replacefilter" | "state/reachable" | "state/production" | "state/pressure" | "state/presenceevent" | "state/presence" | "state/power" | "state/pm2_5" | "state/panel" | "state/orientation_z" | "state/orientation_y" | "state/orientation_x" | "state/orientation" | "state/open" | "state/on" | "state/mountingmodeactive" | "state/lux" | "state/lowbattery" | "state/lockstate" | "state/localtime" | "state/lightlevel" | "state/lift" | "state/lastupdated" | "state/lastset" | "state/lastcheckin" | "state/humidity" | "state/hue" | "state/heating" | "state/gradient" | "state/gesture" | "state/fire" | "state/filterruntime" | "state/expectedrotation" | "state/expectedeventduration" | "state/eventduration" | "state/errorcode" | "state/effect" | "state/deviceruntime" | "state/daylight" | "state/dark" | "state/current" | "state/current_P3" | "state/current_P2" | "state/current_P1" | "state/ct" | "state/consumption" | "state/consumption_2" | "state/y" | "state/x" | "state/colormode" | "state/charging" | "state/carbonmonoxide" | "state/buttonevent" | "state/bri" | "state/battery" | "state/angle" | "state/alert" | "state/alarm" | "state/airqualityppb" | "state/airquality" | "state/action" | "config/windowopen_set" | "config/windowcoveringtype" | "config/usertest" | "config/unoccupiedheatsetpoint" | "config/triggerdistance" | "config/tholdoffset" | "config/tholddark" | "config/temperature" | "config/swingmode" | "config/sensitivitymax" | "config/sensitivity" | "config/selftest" | "config/schedule_on" | "config/schedule" | "config/resetpresence" | "config/reachable" | "config/pulseconfiguration" | "config/preset" | "config/pending" | "config/on/startup" | "config/on" | "config/offset" | "config/mountingmode" | "config/mode" | "config/locked" | "config/lock" | "config/ledindication" | "config/interfacemode" | "config/heatsetpoint" | "config/group" | "config/filterlifetime" | "config/fanmode" | "config/externalwindowopen" | "config/externalsensortemp" | "config/enrolled" | "config/duration" | "config/displayflipped" | "config/devicemode" | "config/delay" | "config/ctmin" | "config/ctmax" | "config/coolsetpoint" | "config/controlsequence" | "config/configured" | "config/colorcapabilities" | "config/color/xy/startup_y" | "config/color/xy/startup_x" | "config/color/gradient/reversed" | "config/color/execute_if_off" | "config/color/ct/startup" | "config/clickmode" | "config/checkin" | "config/bri/startup" | "config/bri/onoff_transitiontime" | "config/bri/on_level" | "config/bri/min" | "config/bri/max" | "config/bri/execute_if_off" | "config/battery" | "config/allowtouchlink" | "config/alert" | "cap/transition_block" | "cap/sleeper" | "cap/on/off_with_effect" | "cap/groups/not_supported" | "cap/color/xy/red_y" | "cap/color/xy/red_x" | "cap/color/xy/green_y" | "cap/color/xy/green_x" | "cap/color/xy/blue_y" | "cap/color/xy/blue_x" | "cap/color/gradient/styles" | "cap/color/gradient/pixel_length" | "cap/color/gradient/pixel_count" | "cap/color/gradient/max_segments" | "cap/color/gamut_type" | "cap/color/effects" | "cap/color/ct/min" | "cap/color/ct/max" | "cap/color/ct/computes_xy" | "cap/color/capabilities" | "cap/bri/move_with_onoff" | "cap/bri/min_dim_level" | "cap/alert/trigger_effect" | "attr/uniqueid" | "attr/type" | "attr/swversion" | "attr/swconfigid" | "attr/productname" | "attr/productid" | "attr/powerup" | "attr/poweronlevel" | "attr/poweronct" | "attr/name" | "attr/modelid" | "attr/mode" | "attr/manufacturername" | "attr/lastseen" | "attr/lastannounced" | "attr/id")[];
696
+ items: ("state/windowopen" | "state/water" | "state/voltage" | "state/vibrationstrength" | "state/vibration" | "state/valve" | "state/utc" | "state/tiltangle" | "state/tilt" | "state/test" | "state/temperature" | "state/tampered" | "state/speed" | "state/seconds_remaining" | "state/sat" | "state/rotaryevent" | "state/replacefilter" | "state/reachable" | "state/production" | "state/pressure" | "state/presenceevent" | "state/presence" | "state/power" | "state/pm2_5" | "state/panel" | "state/orientation_z" | "state/orientation_y" | "state/orientation_x" | "state/orientation" | "state/open" | "state/on" | "state/mountingmodeactive" | "state/moisture" | "state/lux" | "state/lowbattery" | "state/lockstate" | "state/localtime" | "state/lightlevel" | "state/lift" | "state/lastupdated" | "state/lastset" | "state/lastcheckin" | "state/humidity" | "state/hue" | "state/heating" | "state/gradient" | "state/gesture" | "state/fire" | "state/filterruntime" | "state/expectedrotation" | "state/expectedeventduration" | "state/eventduration" | "state/errorcode" | "state/effect" | "state/deviceruntime" | "state/daylight" | "state/dark" | "state/current" | "state/current_P3" | "state/current_P2" | "state/current_P1" | "state/ct" | "state/consumption" | "state/consumption_2" | "state/y" | "state/x" | "state/colormode" | "state/charging" | "state/carbonmonoxide" | "state/buttonevent" | "state/bri" | "state/battery" | "state/angle" | "state/alert" | "state/alarm" | "state/airqualityppb" | "state/airquality" | "state/action" | "config/windowopen_set" | "config/windowcoveringtype" | "config/volume" | "config/usertest" | "config/unoccupiedheatsetpoint" | "config/tuya_unlock" | "config/triggerdistance" | "config/tholdoffset" | "config/tholddark" | "config/temperature" | "config/swingmode" | "config/speed" | "config/sensitivitymax" | "config/sensitivity" | "config/selftest" | "config/schedule_on" | "config/schedule" | "config/reversed" | "config/resetpresence" | "config/reachable" | "config/pulseconfiguration" | "config/preset" | "config/pending" | "config/on/startup" | "config/on" | "config/offset" | "config/mountingmode" | "config/mode" | "config/melody" | "config/locked" | "config/lock" | "config/ledindication" | "config/interfacemode" | "config/heatsetpoint" | "config/group" | "config/filterlifetime" | "config/fanmode" | "config/externalwindowopen" | "config/externalsensortemp" | "config/enrolled" | "config/duration" | "config/displayflipped" | "config/devicemode" | "config/delay" | "config/ctmin" | "config/ctmax" | "config/coolsetpoint" | "config/controlsequence" | "config/configured" | "config/colorcapabilities" | "config/color/xy/startup_y" | "config/color/xy/startup_x" | "config/color/gradient/reversed" | "config/color/execute_if_off" | "config/color/ct/startup" | "config/clickmode" | "config/checkin" | "config/bri/startup" | "config/bri/onoff_transitiontime" | "config/bri/on_level" | "config/bri/min" | "config/bri/max" | "config/bri/execute_if_off" | "config/battery" | "config/allowtouchlink" | "config/alert" | "cap/transition_block" | "cap/sleeper" | "cap/on/off_with_effect" | "cap/groups/not_supported" | "cap/color/xy/red_y" | "cap/color/xy/red_x" | "cap/color/xy/green_y" | "cap/color/xy/green_x" | "cap/color/xy/blue_y" | "cap/color/xy/blue_x" | "cap/color/gradient/styles" | "cap/color/gradient/pixel_length" | "cap/color/gradient/pixel_count" | "cap/color/gradient/max_segments" | "cap/color/gamut_type" | "cap/color/effects" | "cap/color/ct/min" | "cap/color/ct/max" | "cap/color/ct/computes_xy" | "cap/color/capabilities" | "cap/bri/move_with_onoff" | "cap/bri/min_dim_level" | "cap/alert/trigger_effect" | "attr/xiaomi" | "attr/uniqueid" | "attr/type" | "attr/swversion" | "attr/swconfigid" | "attr/productname" | "attr/productid" | "attr/powerup" | "attr/poweronlevel" | "attr/poweronct" | "attr/name" | "attr/modelid" | "attr/mode" | "attr/manufacturername" | "attr/lastseen" | "attr/lastannounced" | "attr/id")[];
470
697
  };
471
698
 
699
+ import type { z } from 'zod'
700
+ import type { resourceSchema } from './schema'
701
+
472
702
  export interface GenericsData {
473
703
  attributes: string[]
704
+ resources: Record<string, Omit<z.infer<ReturnType<typeof resourceSchema>>, 'schema' | 'id'>>
474
705
  manufacturers: Record<string, string>
475
706
  deviceTypes: Record<string, string>
476
707
  }