@deconz-community/ddf-validator 2.32.0 → 2.33.2

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.
@@ -1 +1 @@
1
- {"$ref":"#/definitions/DDF","definitions":{"DDF":{"anyOf":[{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"devcap1.schema.json"},"uuid":{"type":"string"},"ddfvalidate":{"type":"boolean"},"version":{"type":"string"},"version_deconz":{"type":"string"},"doc:path":{"type":"string"},"doc:hdr":{"type":"string"},"md:changelogs":{"type":"array","items":{"type":"string"},"description":"Changelogs for this device, markdown file."},"md:info":{"type":"array","items":{"type":"string"},"description":"Notes info for this device, markdown file."},"md:warning":{"type":"array","items":{"type":"string"},"description":"Notes warning for this device, markdown file."},"md:known_issues":{"type":"array","items":{"type":"string"},"description":"Know issues for this device, markdown file."},"manufacturername":{"anyOf":[{"type":"string","enum":["$MF_AQARA","$MF_BOSCH","$MF_IKEA","$MF_LUMI","$MF_LUTRON","$MF_PHILIPS","$MF_SAMJIN","$MF_SIGNIFY","$MF_TUYA","$MF_XIAOMI"]},{"type":"string","pattern":"^(?!\\$MF_).*"},{"type":"array","items":{"anyOf":[{"type":"string","enum":["$MF_AQARA","$MF_BOSCH","$MF_IKEA","$MF_LUMI","$MF_LUTRON","$MF_PHILIPS","$MF_SAMJIN","$MF_SIGNIFY","$MF_TUYA","$MF_XIAOMI"]},{"type":"string","pattern":"^(?!\\$MF_).*"}]}}],"description":"Manufacturer name from Basic Cluster."},"modelid":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Model ID from Basic Cluster."},"vendor":{"type":"string","description":"Friendly name of the manufacturer."},"product":{"type":"string","description":"Friendly name of the product."},"comment":{"type":"string"},"matchexpr":{"type":"string","description":"Need to return true for the DDF be used."},"path":{"type":"string","description":"DDF path, useless, can be removed."},"sleeper":{"type":"boolean","description":"Sleeping devices can only receive when awake."},"supportsMgmtBind":{"type":"boolean"},"status":{"type":"string","enum":["Draft","Bronze","Silver","Gold"],"description":"The code quality of the DDF file."},"subdevices":{"type":"array","items":{"type":"object","properties":{"type":{"anyOf":[{"type":"string","enum":["$TYPE_AIR_PURIFIER","$TYPE_AIR_QUALITY_SENSOR","$TYPE_CARBONDIOXIDE_SENSOR","$TYPE_CARBONMONOXIDE_SENSOR","$TYPE_FORMALDEHYDE_SENSOR","$TYPE_PARTICULATEMATTER_SENSOR","$TYPE_ALARM_SENSOR","$TYPE_ANCILLARY_CONTROL","$TYPE_BATTERY_SENSOR","$TYPE_COLOR_LIGHT","$TYPE_COLOR_TEMPERATURE_LIGHT","$TYPE_CONSUMPTION_SENSOR","$TYPE_DIMMABLE_LIGHT","$TYPE_DIMMABLE_PLUGIN_UNIT","$TYPE_DIMMER_SWITCH","$TYPE_DOOR_LOCK","$TYPE_DOOR_LOCK_CONTROLLER","$TYPE_DOOR_LOCK_SENSOR","$TYPE_EXTENDED_COLOR_LIGHT","$TYPE_FIRE_SENSOR","$TYPE_HUMIDITY_SENSOR","$TYPE_LEVEL_CONTROL_SWITCH","$TYPE_LIGHT_LEVEL_SENSOR","$TYPE_MOISTURE_SENSOR","$TYPE_ON_OFF_LIGHT","$TYPE_ON_OFF_LIGHT_SWITCH","$TYPE_ON_OFF_OUTPUT","$TYPE_ON_OFF_PLUGIN_UNIT","$TYPE_ON_OFF_SWITCH","$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"]},{"type":"string","pattern":"^(?!\\$TYPE_).*"}]},"restapi":{"type":"string","enum":["/lights","/sensors"]},"uuid":{"anyOf":[{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"string","const":"$address.ext"},{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"}]},{"type":"array","minItems":3,"maxItems":3,"items":[{"type":"string","const":"$address.ext"},{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"}]}]},"fingerprint":{"type":"object","properties":{"profile":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"},"device":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"},"endpoint":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number","minimum":0,"maximum":255}]},"in":{"type":"array","items":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"}},"out":{"type":"array","items":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"}}},"required":["profile","device","endpoint"],"additionalProperties":false},"meta":{"type":"object","properties":{"values":{},"group.endpoints":{"type":"array","items":{"type":"number"}}},"additionalProperties":false},"buttons":{},"buttonevents":{},"items":{"type":"array","items":{"type":"object","properties":{"ddfvalidate":{"type":"boolean"},"description":{"type":"string","description":"Item description, better to do not use it."},"comment":{"type":"string","description":"TODO: What is this ? What the difference with description ?"},"deprecated":{"type":"string","pattern":"^(\\d{4})-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:0[1-9])|(?:[12][0-9])|(?:3[01]))$","description":"Date of deprecation, if the item is deprecated, it's better to use the new one."},"datatype":{"type":"string","enum":["String","Bool","Int8","Int16","Int32","Int64","UInt8","UInt16","UInt32","UInt64","Double","Array","Array[3]","ISO 8601 timestamp"],"description":"Data type of the item."},"access":{"type":"string","enum":["R","W","RW"],"description":"Access mode for this item, some of them are not editable."},"public":{"type":"boolean","description":"Item visible on the API."},"implicit":{"type":"boolean","description":"TODO: What is this ?"},"managed":{"type":"boolean","description":"TODO: What is this ?"},"awake":{"type":"boolean","description":"The device is considered awake when this item is set due a incoming command."},"static":{"type":["string","number","boolean"],"description":"A static default value is fixed and can be not changed."},"range":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}],"description":"Values range limit."},"virtual":{"type":"boolean","description":"TODO: What is this ?"},"read":{"anyOf":[{"type":"object","properties":{"fn":{"type":"string","const":"none"}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number","minimum":0,"maximum":255}],"description":"Endpoint, 255 means any endpoint, 0 means auto selected from subdevice."},"cl":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$","description":"Cluster ID."},"at":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"},{"type":"array","items":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"}}],"description":"Attribute ID."},"mf":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$","description":"Manufacturer code, must be set to 0x0000 for non manufacturer specific commands."},"cmd":{"anyOf":[{"type":"string","const":"any"},{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"}],"description":"Zigbee command."},"fc":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number"}],"description":"Zigbee command frame control."},"eval":{"type":"string","description":"Javascript expression to transform the attribute value to the Item value."},"script":{"type":"string","description":"Relative path of a Javascript .js file."},"fn":{"not":{},"description":"Generic function to read ZCL attributes."}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"tuya","description":"Generic function to read all Tuya datapoints. It has no parameters."}},"required":["fn"],"additionalProperties":false}],"description":"Fonction used to read value."},"parse":{"anyOf":[{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"not":{},"description":"Generic function to read ZCL attributes."},"cppsrc":{"type":"string"}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"ias:zonestatus","description":"Generic function to parse IAS ZONE status change notifications or zone status from read/report command."},"mask":{"anyOf":[{"type":"string","enum":["alarm1","alarm2"]},{"type":"string","const":"alarm1,alarm2"}],"description":"Sets the bitmask for Alert1 and Alert2 item of the IAS Zone status."}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"numtostr","description":"Generic function to to convert number to string."},"srcitem":{"type":"string","enum":["state/y","state/x","state/windowopen","state/water","state/water_bis","state/voltage","state/vibrationstrength","state/vibration","state/valve","state/utc","state/tiltangle","state/tilt","state/test","state/temperature","state/temperature_bis","state/targetdistance","state/tampered","state/speed","state/seconds_remaining","state/sat","state/rotaryevent","state/replacefilter","state/reachable","state/production","state/pressure","state/pressure_bis","state/presenceevent","state/presence","state/power","state/pm2_5","state/panel","state/orientation_z","state/orientation_y","state/orientation_x","state/open","state/open_bis","state/on","state/music_sync","state/mountingmodeactive","state/moisture","state/measured_value","state/lux","state/lowbattery","state/lockstate","state/localtime","state/lightlevel","state/lift","state/lastupdated","state/lastset","state/lastcheckin","state/humidity","state/humidity_bis","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_P3","state/current_P2","state/current_P1","state/current","state/ct","state/consumption","state/consumption_2","state/colormode","state/charging","state/carbonmonoxide","state/buttonevent","state/bri","state/battery","state/angle","state/alert","state/alarm","state/airqualityppb","state/airqualityppb_bis","state/airquality","state/airquality_bis","state/action","config/windowopen_set","config/windowcoveringtype","config/volume","config/usertest","config/unoccupiedheatsetpoint","config/tuya_unlock","config/triggerdistance","config/triggerdistance_bis","config/tholdoffset","config/tholddark","config/temperature","config/swingmode","config/speed","config/sensitivitymax","config/sensitivity","config/sensitivity_bis","config/selftest","config/schedule_on","config/schedule","config/reversed","config/resetpresence","config/reportgrid","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/fadingtime","config/externalwindowopen","config/externalsensortemp","config/enrolled","config/duration","config/displayflipped","config/devicemode","config/devicemode_bis","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/gradient/pixel_count","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/battery_bis","config/allowtouchlink","config/alert","cap/transition_block","cap/sleeper","cap/on/off_with_effect","cap/measured_value/unit","cap/measured_value/substance","cap/measured_value/quantity","cap/measured_value/min","cap/measured_value/max","cap/groups/not_supported","cap/group","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/swversion_bis","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"],"description":"The source item holding the number."},"op":{"type":"string","enum":["lt","le","eq","gt","ge"],"description":"Comparison operator (lt | le | eq | gt | ge)"},"to":{"description":"Array of (num, string) mappings"}},"required":["fn","srcitem","op","to"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"time","description":"Specialized function to parse time, local and last set time from read/report commands of the time cluster and auto-sync time if needed."}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"xiaomi:special","description":"Generic function to parse custom Xiaomi attributes and commands."},"idx":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"A 8-bit string hex value."}},"required":["fn","idx"],"additionalProperties":false},{"type":"object","properties":{"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"tuya","description":"Generic function to parse Tuya data."},"dpid":{"type":"number","description":"Data point ID. 1-255 the datapoint ID."}},"required":["fn","dpid"],"additionalProperties":false}],"description":"Fonction used to parse incoming values."},"write":{"anyOf":[{"type":"object","properties":{"fn":{"type":"string","const":"none"}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"type":"number"},"change.timeout":{"type":"number"},"dt":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"Data type."},"fn":{"not":{},"description":"Generic function to read ZCL attributes."},"cppsrc":{"type":"string"}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"tuya","description":"Generic function to write Tuya data."},"dpid":{"type":"number","description":"Data point ID. 1-255 the datapoint ID."},"dt":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"Data type."}},"required":["fn","dpid","dt"],"additionalProperties":false}],"description":"Fonction used to write value."},"refresh.interval":{"type":"number","description":"Refresh interval used for read fonction, NEED to be superior at value used in binding part."},"values":{"description":"TODO: What is this ?"},"default":{"description":"Defaut value."},"name":{"type":"string","enum":["state/y","state/x","state/windowopen","state/water","state/water_bis","state/voltage","state/vibrationstrength","state/vibration","state/valve","state/utc","state/tiltangle","state/tilt","state/test","state/temperature","state/temperature_bis","state/targetdistance","state/tampered","state/speed","state/seconds_remaining","state/sat","state/rotaryevent","state/replacefilter","state/reachable","state/production","state/pressure","state/pressure_bis","state/presenceevent","state/presence","state/power","state/pm2_5","state/panel","state/orientation_z","state/orientation_y","state/orientation_x","state/open","state/open_bis","state/on","state/music_sync","state/mountingmodeactive","state/moisture","state/measured_value","state/lux","state/lowbattery","state/lockstate","state/localtime","state/lightlevel","state/lift","state/lastupdated","state/lastset","state/lastcheckin","state/humidity","state/humidity_bis","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_P3","state/current_P2","state/current_P1","state/current","state/ct","state/consumption","state/consumption_2","state/colormode","state/charging","state/carbonmonoxide","state/buttonevent","state/bri","state/battery","state/angle","state/alert","state/alarm","state/airqualityppb","state/airqualityppb_bis","state/airquality","state/airquality_bis","state/action","config/windowopen_set","config/windowcoveringtype","config/volume","config/usertest","config/unoccupiedheatsetpoint","config/tuya_unlock","config/triggerdistance","config/triggerdistance_bis","config/tholdoffset","config/tholddark","config/temperature","config/swingmode","config/speed","config/sensitivitymax","config/sensitivity","config/sensitivity_bis","config/selftest","config/schedule_on","config/schedule","config/reversed","config/resetpresence","config/reportgrid","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/fadingtime","config/externalwindowopen","config/externalsensortemp","config/enrolled","config/duration","config/displayflipped","config/devicemode","config/devicemode_bis","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/gradient/pixel_count","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/battery_bis","config/allowtouchlink","config/alert","cap/transition_block","cap/sleeper","cap/on/off_with_effect","cap/measured_value/unit","cap/measured_value/substance","cap/measured_value/quantity","cap/measured_value/min","cap/measured_value/max","cap/groups/not_supported","cap/group","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/swversion_bis","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"],"description":"Item name."}},"required":["name"],"additionalProperties":false}},"example":{}},"required":["type","restapi","uuid","items"],"additionalProperties":false},"description":"Devices section."},"bindings":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"bind":{"type":"string","const":"unicast"},"src.ep":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number","minimum":0,"maximum":255}],"description":"Source endpoint."},"dst.ep":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number","minimum":0,"maximum":255}],"description":"Destination endpoint, generaly 0x01."},"cl":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$","description":"Cluster."},"report":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"},"dt":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},"mf":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"},"min":{"type":"number"},"max":{"type":"number"},"change":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]+$"},{"type":"number"}]}},"required":["at","dt","min","max"],"additionalProperties":false}}},"required":["bind","src.ep","cl"],"additionalProperties":false},{"type":"object","properties":{"bind":{"type":"string","const":"groupcast"},"src.ep":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number","minimum":0,"maximum":255}],"description":"Source endpoint."},"cl":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$","description":"Cluster."},"config.group":{"type":"number","minimum":0,"maximum":255}},"required":["bind","src.ep","cl","config.group"],"additionalProperties":false}]},"description":"Bindings section."}},"required":["schema","manufacturername","modelid","status","subdevices"],"additionalProperties":false},{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"constants1.schema.json"},"ddfvalidate":{"type":"boolean"},"manufacturers":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"pattern":"^\\$MF\\_"}},"device-types":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"pattern":"^\\$TYPE\\_"}}},"required":["schema","manufacturers","device-types"],"additionalProperties":false},{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"constants2.schema.json"},"ddfvalidate":{"type":"boolean"}},"required":["schema"],"additionalProperties":true},{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"resourceitem1.schema.json"},"id":{"type":"string"},"ddfvalidate":{"type":"boolean"},"description":{"type":"string","description":"Item description, better to do not use it."},"comment":{"type":"string","description":"TODO: What is this ? What the difference with description ?"},"deprecated":{"type":"string","pattern":"^(\\d{4})-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:0[1-9])|(?:[12][0-9])|(?:3[01]))$","description":"Date of deprecation, if the item is deprecated, it's better to use the new one."},"datatype":{"type":"string","enum":["String","Bool","Int8","Int16","Int32","Int64","UInt8","UInt16","UInt32","UInt64","Double","Array","Array[3]","ISO 8601 timestamp"],"description":"Data type of the item."},"access":{"type":"string","enum":["R","W","RW"],"description":"Access mode for this item, some of them are not editable."},"public":{"type":"boolean","description":"Item visible on the API."},"implicit":{"type":"boolean","description":"TODO: What is this ?"},"managed":{"type":"boolean","description":"TODO: What is this ?"},"awake":{"type":"boolean","description":"The device is considered awake when this item is set due a incoming command."},"static":{"type":["string","number","boolean"],"description":"A static default value is fixed and can be not changed."},"range":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}],"description":"Values range limit."},"virtual":{"type":"boolean","description":"TODO: What is this ?"},"read":{"anyOf":[{"type":"object","properties":{"fn":{"type":"string","const":"none"}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"not":{},"description":"Generic function to read ZCL attributes."}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"tuya","description":"Generic function to read all Tuya datapoints. It has no parameters."}},"required":["fn"],"additionalProperties":false}],"description":"Fonction used to read value."},"parse":{"anyOf":[{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"not":{},"description":"Generic function to read ZCL attributes."},"cppsrc":{"type":"string"}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"ias:zonestatus","description":"Generic function to parse IAS ZONE status change notifications or zone status from read/report command."},"mask":{"anyOf":[{"type":"string","enum":["alarm1","alarm2"]},{"type":"string","const":"alarm1,alarm2"}],"description":"Sets the bitmask for Alert1 and Alert2 item of the IAS Zone status."}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"numtostr","description":"Generic function to to convert number to string."},"srcitem":{"type":"string","enum":["state/y","state/x","state/windowopen","state/water","state/water_bis","state/voltage","state/vibrationstrength","state/vibration","state/valve","state/utc","state/tiltangle","state/tilt","state/test","state/temperature","state/temperature_bis","state/targetdistance","state/tampered","state/speed","state/seconds_remaining","state/sat","state/rotaryevent","state/replacefilter","state/reachable","state/production","state/pressure","state/pressure_bis","state/presenceevent","state/presence","state/power","state/pm2_5","state/panel","state/orientation_z","state/orientation_y","state/orientation_x","state/open","state/open_bis","state/on","state/music_sync","state/mountingmodeactive","state/moisture","state/measured_value","state/lux","state/lowbattery","state/lockstate","state/localtime","state/lightlevel","state/lift","state/lastupdated","state/lastset","state/lastcheckin","state/humidity","state/humidity_bis","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_P3","state/current_P2","state/current_P1","state/current","state/ct","state/consumption","state/consumption_2","state/colormode","state/charging","state/carbonmonoxide","state/buttonevent","state/bri","state/battery","state/angle","state/alert","state/alarm","state/airqualityppb","state/airqualityppb_bis","state/airquality","state/airquality_bis","state/action","config/windowopen_set","config/windowcoveringtype","config/volume","config/usertest","config/unoccupiedheatsetpoint","config/tuya_unlock","config/triggerdistance","config/triggerdistance_bis","config/tholdoffset","config/tholddark","config/temperature","config/swingmode","config/speed","config/sensitivitymax","config/sensitivity","config/sensitivity_bis","config/selftest","config/schedule_on","config/schedule","config/reversed","config/resetpresence","config/reportgrid","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/fadingtime","config/externalwindowopen","config/externalsensortemp","config/enrolled","config/duration","config/displayflipped","config/devicemode","config/devicemode_bis","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/gradient/pixel_count","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/battery_bis","config/allowtouchlink","config/alert","cap/transition_block","cap/sleeper","cap/on/off_with_effect","cap/measured_value/unit","cap/measured_value/substance","cap/measured_value/quantity","cap/measured_value/min","cap/measured_value/max","cap/groups/not_supported","cap/group","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/swversion_bis","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"],"description":"The source item holding the number."},"op":{"type":"string","enum":["lt","le","eq","gt","ge"],"description":"Comparison operator (lt | le | eq | gt | ge)"},"to":{"description":"Array of (num, string) mappings"}},"required":["fn","srcitem","op","to"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"time","description":"Specialized function to parse time, local and last set time from read/report commands of the time cluster and auto-sync time if needed."}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"xiaomi:special","description":"Generic function to parse custom Xiaomi attributes and commands."},"idx":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"A 8-bit string hex value."}},"required":["fn","idx"],"additionalProperties":false},{"type":"object","properties":{"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"tuya","description":"Generic function to parse Tuya data."},"dpid":{"type":"number","description":"Data point ID. 1-255 the datapoint ID."}},"required":["fn","dpid"],"additionalProperties":false}],"description":"Fonction used to parse incoming values."},"write":{"anyOf":[{"type":"object","properties":{"fn":{"type":"string","const":"none"}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"not":{},"description":"Generic function to read ZCL attributes."},"cppsrc":{"type":"string"}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"tuya","description":"Generic function to write Tuya data."},"dpid":{"type":"number","description":"Data point ID. 1-255 the datapoint ID."},"dt":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"Data type."}},"required":["fn","dpid","dt"],"additionalProperties":false}],"description":"Fonction used to write value."},"refresh.interval":{"type":"number","description":"Refresh interval used for read fonction, NEED to be superior at value used in binding part."},"values":{"description":"TODO: What is this ?"},"default":{"description":"Defaut value."}},"required":["schema","id"],"additionalProperties":false},{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"subdevice1.schema.json"},"ddfvalidate":{"type":"boolean"},"type":{"anyOf":[{"type":"string","enum":["$TYPE_AIR_PURIFIER","$TYPE_AIR_QUALITY_SENSOR","$TYPE_CARBONDIOXIDE_SENSOR","$TYPE_CARBONMONOXIDE_SENSOR","$TYPE_FORMALDEHYDE_SENSOR","$TYPE_PARTICULATEMATTER_SENSOR","$TYPE_ALARM_SENSOR","$TYPE_ANCILLARY_CONTROL","$TYPE_BATTERY_SENSOR","$TYPE_COLOR_LIGHT","$TYPE_COLOR_TEMPERATURE_LIGHT","$TYPE_CONSUMPTION_SENSOR","$TYPE_DIMMABLE_LIGHT","$TYPE_DIMMABLE_PLUGIN_UNIT","$TYPE_DIMMER_SWITCH","$TYPE_DOOR_LOCK","$TYPE_DOOR_LOCK_CONTROLLER","$TYPE_DOOR_LOCK_SENSOR","$TYPE_EXTENDED_COLOR_LIGHT","$TYPE_FIRE_SENSOR","$TYPE_HUMIDITY_SENSOR","$TYPE_LEVEL_CONTROL_SWITCH","$TYPE_LIGHT_LEVEL_SENSOR","$TYPE_MOISTURE_SENSOR","$TYPE_ON_OFF_LIGHT","$TYPE_ON_OFF_LIGHT_SWITCH","$TYPE_ON_OFF_OUTPUT","$TYPE_ON_OFF_PLUGIN_UNIT","$TYPE_ON_OFF_SWITCH","$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"]},{"type":"string","pattern":"^(?!\\$TYPE_).*"}]},"name":{"type":"string"},"restapi":{"type":"string","enum":["/lights","/sensors"]},"order":{"type":"number"},"uuid":{"anyOf":[{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"string","const":"$address.ext"},{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"}]},{"type":"array","minItems":3,"maxItems":3,"items":[{"type":"string","const":"$address.ext"},{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"}]}]},"items":{"type":"array","items":{"type":"string","enum":["state/y","state/x","state/windowopen","state/water","state/water_bis","state/voltage","state/vibrationstrength","state/vibration","state/valve","state/utc","state/tiltangle","state/tilt","state/test","state/temperature","state/temperature_bis","state/targetdistance","state/tampered","state/speed","state/seconds_remaining","state/sat","state/rotaryevent","state/replacefilter","state/reachable","state/production","state/pressure","state/pressure_bis","state/presenceevent","state/presence","state/power","state/pm2_5","state/panel","state/orientation_z","state/orientation_y","state/orientation_x","state/open","state/open_bis","state/on","state/music_sync","state/mountingmodeactive","state/moisture","state/measured_value","state/lux","state/lowbattery","state/lockstate","state/localtime","state/lightlevel","state/lift","state/lastupdated","state/lastset","state/lastcheckin","state/humidity","state/humidity_bis","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_P3","state/current_P2","state/current_P1","state/current","state/ct","state/consumption","state/consumption_2","state/colormode","state/charging","state/carbonmonoxide","state/buttonevent","state/bri","state/battery","state/angle","state/alert","state/alarm","state/airqualityppb","state/airqualityppb_bis","state/airquality","state/airquality_bis","state/action","config/windowopen_set","config/windowcoveringtype","config/volume","config/usertest","config/unoccupiedheatsetpoint","config/tuya_unlock","config/triggerdistance","config/triggerdistance_bis","config/tholdoffset","config/tholddark","config/temperature","config/swingmode","config/speed","config/sensitivitymax","config/sensitivity","config/sensitivity_bis","config/selftest","config/schedule_on","config/schedule","config/reversed","config/resetpresence","config/reportgrid","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/fadingtime","config/externalwindowopen","config/externalsensortemp","config/enrolled","config/duration","config/displayflipped","config/devicemode","config/devicemode_bis","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/gradient/pixel_count","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/battery_bis","config/allowtouchlink","config/alert","cap/transition_block","cap/sleeper","cap/on/off_with_effect","cap/measured_value/unit","cap/measured_value/substance","cap/measured_value/quantity","cap/measured_value/min","cap/measured_value/max","cap/groups/not_supported","cap/group","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/swversion_bis","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"]}},"items_optional":{"$ref":"#/definitions/DDF/anyOf/4/properties/items"}},"required":["schema","type","name","restapi","order","uuid","items"],"additionalProperties":false}]}},"$schema":"http://json-schema.org/draft-07/schema#"}
1
+ {"$ref":"#/definitions/DDF","definitions":{"DDF":{"type":"string"}},"$schema":"http://json-schema.org/draft-07/schema#"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),G="2.32.0",w={"devcap1.schema.json":[M,P,W,L,R,Y],"constants2.schema.json":[N]};function M(t,r,u){const i=typeof t.manufacturername=="string"&&typeof t.modelid=="string";if(i)return;const c=Array.isArray(t.manufacturername)&&Array.isArray(t.modelid);if(c&&t.manufacturername.length!==t.modelid.length){r.addIssue({code:e.z.ZodIssueCode.invalid_intersection_types,message:"When 'manufacturername' and 'modelid' are both arrays they should be the same length",path:["manufacturername","modelid"]});return}(i||c)===!1&&r.addIssue({code:e.z.ZodIssueCode.invalid_intersection_types,message:"Invalid properties 'manufacturername' and 'modelid' should have the same type",path:["manufacturername","modelid"]})}function P(t,r,u){if(!t.bindings)return;const i=n=>`0x${(typeof n=="number"?n:Number.parseInt(n,16)).toString(16)}`,c={};t.bindings.forEach(n=>{n.bind==="unicast"&&n.report&&n.report.forEach(d=>{d.max!==65535&&(c[`${i(n["src.ep"])}.${i(n.cl)}.${i(d.at)}`]=d.max)})}),t.subdevices.forEach((n,d)=>{n.items.forEach((a,m)=>{var s;if(a["refresh.interval"]&&a.read&&a.read.fn==="zcl:attr"&&a.read.at){const o=i(a.read.ep??((s=n.fingerprint)==null?void 0:s.endpoint)??n.uuid[1]),p=Array.isArray(a.read.at)?a.read.at:[a.read.at];for(let h=0;h<p.length;h++){const z=`${o}.${i(a.read.cl)}.${i(p[h])}`;c[z]!==void 0&&a["refresh.interval"]-60<c[z]&&r.addIssue({code:e.z.ZodIssueCode.custom,message:`The refresh interval (${a["refresh.interval"]} - 60 = ${a["refresh.interval"]-60}) should be greater than the binding max refresh value (${c[z]}) with a margin of 60 seconds`,path:["subdevices",d,"items",m,"refresh.interval"]})}}})})}function W(t,r,u){const i=[{description:'a device with "state/ct" need the "min" and "max" values for capability.',if:{item:"state/ct"},need:{item:["cap/color/ct/min","cap/color/ct/max"]}},{description:'a device with "cap/color/ct/computes_xy" need the corresponding state/{x,y} items',if:{item:"cap/color/ct/computes_xy"},need:{item:["state/x","state/y","state/ct"]}},{description:'a device with "state/x" or "state/y" need the corresponding cap/color/xy/{red,green,blue}/{x,y} items',if:{item:{or:["state/x","state/y"]}},need:{item:["state/x","state/y","cap/color/xy/red_x","cap/color/xy/green_x","cap/color/xy/blue_x","cap/color/xy/red_y","cap/color/xy/green_y","cap/color/xy/blue_y"]}},{description:'a "(Extended) Color light" need ("state/x" and "state/y") or/and ("state/hue" and "state/sat") .',if:{type:{or:["$TYPE_EXTENDED_COLOR_LIGHT","Extended color light","$TYPE_COLOR_LIGHT","Color light"]}},need:{item:{or:[["state/x","state/y"],["state/hue","state/sat"]]}}}],c=(n,d)=>typeof n=="string"?d(n):Array.isArray(n)?n.every(a=>c(a,d)):"and"in n?n.and.every(a=>c(a,d)):"or"in n?n.or.some(a=>c(a,d)):!1;t.subdevices.forEach((n,d)=>{const a=n.items.map(m=>m.name);i.forEach(m=>{(Object.keys(m.if).length===0||Object.entries(m.if).some(([s,o])=>{switch(s){case"type":return c(o,p=>p===n.type);case"item":return c(o,p=>a.includes(p));default:return!1}}))&&(c(m.need.item,s=>a.includes(s))||r.addIssue({code:e.z.ZodIssueCode.custom,message:`The device is missing some items because ${m.description}`,path:["subdevices",d,"items"]}))})})}function L(t,r,u){const i=["parse","write"];t.subdevices.forEach((c,n)=>{c.items.forEach((d,a)=>{i.forEach(m=>{const s=d[m];s!==void 0&&(s.fn===void 0||s.fn==="zcl:attr"||s.fn==="zcl:cmd")&&(s.eval===void 0&&s.script===void 0&&r.addIssue({code:e.z.ZodIssueCode.custom,message:`The '${m}' function is missing 'eval' or 'script' option.`,path:["subdevices",n,"items",a,m]}),s.eval!==void 0&&s.script!==void 0&&r.addIssue({code:e.z.ZodIssueCode.custom,message:`The '${m}' function is having both 'eval' and 'script' option.`,path:["subdevices",n,"items",a,m]}))})})})}function N(t,r,u){const i=D();Object.keys(t).forEach(c=>{if(!Object.keys(i.shape).includes(c)){if(!["$MF_","$TYPE_"].some(n=>c.startsWith(n))){r.addIssue({code:e.z.ZodIssueCode.custom,message:"The constant key should start with '$MF_' or '$TYPE_'",path:[c]});return}typeof t[c]!="string"&&r.addIssue({code:e.z.ZodIssueCode.custom,message:"The constant value should be a string",path:[c]})}})}function R(t,r,u){t.subdevices.forEach((i,c)=>{const n=u.subDevices[i.type];if(!n){r.addIssue({code:e.z.ZodIssueCode.custom,message:`The device is missing the device definition (subdevice1.schema.json) for the type "${i.type}"`,path:["subdevices",c,"items"]});return}let d=n.items;n.items_optional&&(d=d.filter(a=>!n.items_optional.includes(a))),d.forEach(a=>{i.items.find(m=>m.name===a)||r.addIssue({code:e.z.ZodIssueCode.custom,message:`The device should have the item "${a}" because it is mandatory for devices of type "${i.type}"`,path:["subdevices",c,"items"]})})})}function Y(t,r,u){t.subdevices.forEach((i,c)=>{const n=i.items.map(d=>d.name);i.items.forEach((d,a)=>{d.parse&&d.parse.fn==="numtostr"&&(n.includes(d.parse.srcitem)||r.addIssue({code:e.z.ZodIssueCode.custom,message:`The device should have the item "${d.parse.srcitem}" because it is used in the 'numtostr' function`,path:["subdevices",c,"items",a,"parse","srcitem"]}))})})}function B(t){return e.z.strictObject({$schema:e.z.optional(e.z.string()),schema:e.z.literal("constants1.schema.json"),ddfvalidate:e.z.optional(e.z.boolean()),manufacturers:e.z.record(e.z.string().startsWith("$MF_"),e.z.string()),"device-types":e.z.record(e.z.string().startsWith("$TYPE_"),e.z.string())})}function D(t){return e.z.object({$schema:e.z.optional(e.z.string()),schema:e.z.literal("constants2.schema.json"),ddfvalidate:e.z.optional(e.z.boolean())}).passthrough()}function U(){return e.z.string().regex(/^(\d{4})-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:0[1-9])|(?:[12][0-9])|(?:3[01]))$/,"Invalid date value")}function l(t=void 0){const r="Invalid hexadecimal value";return t===void 0?e.z.string().regex(/^0x[0-9a-fA-F]+$/,r):e.z.string().regex(new RegExp(`^0x[0-9a-fA-F]{${t}}$`),r)}function v(){return e.z.union([l(2),e.z.number().min(0).max(255)])}function k(){return e.z.custom(t=>{if(!Array.isArray(t)||t.length%2!==0)return!1;for(let r=0;r<t.length;r+=2){const u=t[r],i=t[r+1];if(typeof u!="number"||typeof i!="string")return!1}return!0},"The value must be an array with an even number of values and alternating between number and string.")}function S(){return e.z.union([e.z.tuple([e.z.literal("$address.ext"),l(2)]),e.z.tuple([e.z.literal("$address.ext"),l(2),l(4)])])}function C(){return e.z.string()}function A(){return e.z.string()}const y=e.z.strictObject({ep:e.z.optional(v()).describe("Endpoint, 255 means any endpoint, 0 means auto selected from subdevice."),cl:l(4).describe("Cluster ID."),at:e.z.optional(l(4).or(e.z.array(l(4)))).describe("Attribute ID."),mf:e.z.optional(l(4)).describe("Manufacturer code, must be set to 0x0000 for non manufacturer specific commands."),cmd:e.z.optional(e.z.union([e.z.literal("any"),l(2)])).describe("Zigbee command."),fc:e.z.optional(l(2).or(e.z.number())).describe("Zigbee command frame control."),eval:e.z.optional(A()).describe("Javascript expression to transform the attribute value to the Item value."),script:e.z.optional(C()).describe("Relative path of a Javascript .js file.")}),f={read:y.extend({}),parse:y.extend({}),write:y.extend({"state.timeout":e.z.optional(e.z.number()),"change.timeout":e.z.optional(e.z.number()),dt:e.z.optional(l(2)).describe("Data type.")})};function V(){return e.z.discriminatedUnion("fn",[e.z.strictObject({fn:e.z.literal("none")}),f.read.extend({fn:e.z.undefined().describe("Generic function to read ZCL attributes.")}),f.read.extend({fn:e.z.literal("zcl:attr").describe("Generic function to parse ZCL values from read/report commands.")}),f.read.extend({fn:e.z.literal("zcl:cmd").describe("Generic function to parse ZCL values from read/report commands.")}),e.z.strictObject({fn:e.z.literal("tuya").describe("Generic function to read all Tuya datapoints. It has no parameters.")})]).refine(t=>!("eval"in t&&"script"in t),{message:"eval and script should not both be present"})}function q(t){return e.z.discriminatedUnion("fn",[f.parse.extend({fn:e.z.undefined().describe("Generic function to read ZCL attributes."),cppsrc:e.z.optional(e.z.string())}),f.parse.extend({fn:e.z.literal("zcl:attr").describe("Generic function to parse ZCL values from read/report commands.")}),f.parse.extend({fn:e.z.literal("zcl:cmd").describe("Generic function to parse ZCL values from read/report commands.")}),e.z.strictObject({fn:e.z.literal("ias:zonestatus").describe("Generic function to parse IAS ZONE status change notifications or zone status from read/report command."),mask:e.z.optional(e.z.enum(["alarm1","alarm2"]).or(e.z.literal("alarm1,alarm2"))).describe("Sets the bitmask for Alert1 and Alert2 item of the IAS Zone status.")}),e.z.strictObject({fn:e.z.literal("numtostr").describe("Generic function to to convert number to string."),srcitem:e.z.enum(t.attributes,{errorMap:(r,u)=>r.code==="invalid_enum_value"?{message:`Invalid enum value. Expected item from generic attributes definition, received '${r.received}'`}:{message:u.defaultError}}).describe("The source item holding the number."),op:e.z.enum(["lt","le","eq","gt","ge"]).describe("Comparison operator (lt | le | eq | gt | ge)"),to:k().describe("Array of (num, string) mappings")}),e.z.strictObject({fn:e.z.literal("time").describe("Specialized function to parse time, local and last set time from read/report commands of the time cluster and auto-sync time if needed.")}),f.parse.pick({ep:!0,at:!0,mf:!0,eval:!0,script:!0}).extend({fn:e.z.literal("xiaomi:special").describe("Generic function to parse custom Xiaomi attributes and commands."),idx:l(2).describe("A 8-bit string hex value.")}),f.parse.pick({eval:!0,script:!0}).extend({fn:e.z.literal("tuya").describe("Generic function to parse Tuya data."),dpid:e.z.number().describe("Data point ID. 1-255 the datapoint ID.")})]).refine(r=>!("eval"in r&&"script"in r),{message:"eval and script should not both be present"})}function H(){return e.z.discriminatedUnion("fn",[e.z.strictObject({fn:e.z.literal("none")}),f.write.extend({fn:e.z.undefined().describe("Generic function to read ZCL attributes."),cppsrc:e.z.optional(e.z.string())}),f.write.extend({fn:e.z.literal("zcl:attr").describe("Generic function to parse ZCL values from read/report commands.")}),f.write.extend({fn:e.z.literal("zcl:cmd").describe("Generic function to parse ZCL values from read/report commands.")}),f.write.pick({eval:!0,script:!0}).extend({fn:e.z.literal("tuya").describe("Generic function to write Tuya data."),dpid:e.z.number().describe("Data point ID. 1-255 the datapoint ID."),dt:l(2).describe("Data type.")})]).refine(t=>!("eval"in t&&"script"in t),{message:"eval and script should not both be present"})}function F(t){return e.z.strictObject({$schema:e.z.optional(e.z.string()),schema:e.z.literal("resourceitem1.schema.json"),id:e.z.string(),ddfvalidate:e.z.optional(e.z.boolean()),description:e.z.optional(e.z.string()).describe("Item description, better to do not use it."),comment:e.z.optional(e.z.string()).describe("TODO: What is this ? What the difference with description ?"),deprecated:e.z.optional(U()).describe("Date of deprecation, if the item is deprecated, it's better to use the new one."),datatype:e.z.optional(e.z.enum(["String","Bool","Int8","Int16","Int32","Int64","UInt8","UInt16","UInt32","UInt64","Double","Array","Array[3]","ISO 8601 timestamp"])).describe("Data type of the item."),access:e.z.optional(e.z.enum(["R","W","RW"])).describe("Access mode for this item, some of them are not editable."),public:e.z.optional(e.z.boolean()).describe("Item visible on the API."),implicit:e.z.optional(e.z.boolean()).describe("TODO: What is this ?"),managed:e.z.optional(e.z.boolean()).describe("TODO: What is this ?"),awake:e.z.optional(e.z.boolean()).describe("The device is considered awake when this item is set due a incoming command."),static:e.z.optional(e.z.union([e.z.string(),e.z.number(),e.z.boolean()])).describe("A static default value is fixed and can be not changed."),range:e.z.optional(e.z.tuple([e.z.number(),e.z.number()])).describe("Values range limit."),virtual:e.z.optional(e.z.boolean()).describe("TODO: What is this ?"),read:e.z.optional(V()).describe("Fonction used to read value."),parse:e.z.optional(q(t)).describe("Fonction used to parse incoming values."),write:e.z.optional(H()).describe("Fonction used to write value."),"refresh.interval":e.z.optional(e.z.number()).describe("Refresh interval used for read fonction, NEED to be superior at value used in binding part."),values:e.z.optional(e.z.unknown()).describe("TODO: What is this ?"),default:e.z.optional(e.z.unknown()).describe("Defaut value.")})}function J(t){return e.z.strictObject({$schema:e.z.optional(e.z.string()),schema:e.z.literal("devcap1.schema.json"),uuid:e.z.optional(e.z.string()),ddfvalidate:e.z.optional(e.z.boolean()),version:e.z.optional(e.z.string()),version_deconz:e.z.optional(e.z.string()),"doc:path":e.z.optional(e.z.string()),"doc:hdr":e.z.optional(e.z.string()),"md:changelogs":e.z.optional(e.z.array(e.z.string())).describe("Changelogs for this device, markdown file."),"md:info":e.z.optional(e.z.array(e.z.string())).describe("Notes info for this device, markdown file."),"md:warning":e.z.optional(e.z.array(e.z.string())).describe("Notes warning for this device, markdown file."),"md:known_issues":e.z.optional(e.z.array(e.z.string())).describe("Know issues for this device, markdown file."),manufacturername:e.z.union([e.z.enum(Object.keys(t.manufacturers)),e.z.string().regex(/^(?!\$MF_).*/g,"The manufacturer name start with $MF_ but is not present in constants.json"),e.z.array(e.z.union([e.z.enum(Object.keys(t.manufacturers)),e.z.string().regex(/^(?!\$MF_).*/g,"The manufacturer name start with $MF_ but is not present in constants.json")]))]).describe("Manufacturer name from Basic Cluster."),modelid:e.z.string().or(e.z.array(e.z.string())).describe("Model ID from Basic Cluster."),vendor:e.z.optional(e.z.string()).describe("Friendly name of the manufacturer."),product:e.z.optional(e.z.string()).describe("Friendly name of the product."),comment:e.z.optional(e.z.string()),matchexpr:e.z.optional(A()).describe("Need to return true for the DDF be used."),path:e.z.optional(C()).describe("DDF path, useless, can be removed."),sleeper:e.z.optional(e.z.boolean()).describe("Sleeping devices can only receive when awake."),supportsMgmtBind:e.z.optional(e.z.boolean()),status:e.z.enum(["Draft","Bronze","Silver","Gold"]).describe("The code quality of the DDF file."),subdevices:e.z.array(X(t)).describe("Devices section."),bindings:e.z.optional(e.z.array(Q())).describe("Bindings section.")})}function X(t){return e.z.strictObject({type:e.z.union([e.z.enum(Object.keys(t.deviceTypes),{errorMap:(r,u)=>r.code==="invalid_enum_value"?{message:`Invalid enum value. Expected type from generic attributes definition, received '${r.received}'`}:{message:u.defaultError}}),e.z.string().regex(/^(?!\$TYPE_).*/g,"The type start with $TYPE_ but is not present in constants.json")]),restapi:e.z.enum(["/lights","/sensors"]),uuid:S(),fingerprint:e.z.optional(e.z.strictObject({profile:l(4),device:l(4),endpoint:v(),in:e.z.optional(e.z.array(l(4))),out:e.z.optional(e.z.array(l(4)))})),meta:e.z.optional(e.z.strictObject({values:e.z.any(),"group.endpoints":e.z.optional(e.z.array(e.z.number()))})),buttons:e.z.optional(e.z.any()),buttonevents:e.z.optional(e.z.any()),items:e.z.array(K(t)),example:e.z.optional(e.z.unknown())})}function K(t){return F(t).omit({$schema:!0,schema:!0,id:!0}).extend({name:e.z.enum(t.attributes,{errorMap:(r,u)=>r.code==="invalid_enum_value"?{message:`Invalid enum value. Expected item from generic attributes definition, received '${r.received}'`}:{message:u.defaultError}}).describe("Item name.")})}function Q(t){return e.z.discriminatedUnion("bind",[e.z.strictObject({bind:e.z.literal("unicast"),"src.ep":v().describe("Source endpoint."),"dst.ep":e.z.optional(v()).describe("Destination endpoint, generaly 0x01."),cl:l(4).describe("Cluster."),report:e.z.optional(e.z.array(e.z.strictObject({at:l(4),dt:l(2),mf:e.z.optional(l(4)),min:e.z.number(),max:e.z.number(),change:e.z.optional(l().or(e.z.number()))}).refine(r=>r.min<=r.max,{message:"invalid report time, min should be smaller than max"})))}),e.z.strictObject({bind:e.z.literal("groupcast"),"src.ep":v().describe("Source endpoint."),cl:l(4).describe("Cluster."),"config.group":e.z.number().min(0).max(255)})])}function ee(t){const r=e.z.array(e.z.enum(t.attributes,{errorMap:(u,i)=>u.code==="invalid_enum_value"?{message:`Invalid enum value. Expected item from generic attributes definition, received '${u.received}'`}:{message:i.defaultError}}));return e.z.strictObject({$schema:e.z.optional(e.z.string()),schema:e.z.literal("subdevice1.schema.json"),ddfvalidate:e.z.optional(e.z.boolean()),type:e.z.union([e.z.enum(Object.keys(t.deviceTypes),{errorMap:(u,i)=>u.code==="invalid_enum_value"?{message:`Invalid enum value. Expected type from generic attributes definition, received '${u.received}'`}:{message:i.defaultError}}),e.z.string().regex(/^(?!\$TYPE_).*/g,"The type start with $TYPE_ but is not present in constants.json")]),name:e.z.string(),restapi:e.z.enum(["/lights","/sensors"]),order:e.z.number(),uuid:S(),items:r,items_optional:e.z.optional(r)})}function O(t){return e.z.discriminatedUnion("schema",[J(t),B(),D(),F(t),ee(t)]).superRefine((r,u)=>{switch(r.schema){case"devcap1.schema.json":w[r.schema].map(i=>i(r,u,t));break;case"constants2.schema.json":w[r.schema].map(i=>i(r,u,t));break}})}function te(t={attributes:[],manufacturers:{},deviceTypes:{},resources:{},subDevices:{}}){let r=O(t);const u=()=>{r=O(t)},i=m=>["constants1.schema.json","constants2.schema.json","resourceitem1.schema.json","subdevice1.schema.json"].includes(m),c=m=>m==="devcap1.schema.json",n=m=>{const s=r.parse(m);switch(s.schema){case"constants1.schema.json":t.manufacturers={...t.manufacturers,...s.manufacturers},t.deviceTypes={...t.deviceTypes,...s["device-types"]};break;case"constants2.schema.json":{Object.keys(s).filter(o=>o.startsWith("$MF_")).forEach(o=>{t.manufacturers[o]=s[o]}),Object.keys(s).filter(o=>o.startsWith("$TYPE_")).forEach(o=>{t.deviceTypes[o]=s[o]});break}case"resourceitem1.schema.json":{if(t.attributes.includes(s.id))throw new Error(`Got duplicate resource item with attribute id '${s.id}'.`);const o=s,p=s.id;delete o.$schema,delete o.schema,delete o.id,t.resources[p]=o,t.attributes.push(p);break}case"subdevice1.schema.json":t.subDevices[s.type]=s,t.subDevices[s.name]=s;break;default:throw new Error(`Got invalid generic file, got data with schema '${s.schema}'.`)}return u(),!0},d=m=>r.parse(m);return{generics:t,loadGeneric:n,validate:d,bulkValidate:(m,s,o={})=>{const p=(h,z)=>{var $,j,E;let x=0,I=Number.POSITIVE_INFINITY,_=h,b=[];for(($=o.onSectionStart)==null||$.call(o,z,h.length);b=[],(j=o.onSectionProgress)==null||j.call(o,z,1,h.length),_.forEach(g=>{var T;(T=o.onSectionProgress)==null||T.call(o,z,x++,h.length);try{z==="generic"?n(g.data):z==="ddf"&&d(g.data)}catch(Z){b.push({...g,error:Z})}}),!(b.length===0||b.length>=I);)x-=b.length,_=b,I=b.length;return(E=o.onSectionEnd)==null||E.call(o,z,h.length,b),b};return[...p(m,"generic"),...p(s,"ddf")]},getSchema:()=>r,version:G,isGeneric:i,isDDF:c}}exports.createValidator=te;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),G="2.33.2",w={"devcap1.schema.json":[M,P,W,L,R,Y],"constants2.schema.json":[N]};function M(t,r,u){const i=typeof t.manufacturername=="string"&&typeof t.modelid=="string";if(i)return;const c=Array.isArray(t.manufacturername)&&Array.isArray(t.modelid);if(c&&t.manufacturername.length!==t.modelid.length){r.addIssue({code:e.z.ZodIssueCode.invalid_intersection_types,message:"When 'manufacturername' and 'modelid' are both arrays they should be the same length",path:["manufacturername","modelid"]});return}(i||c)===!1&&r.addIssue({code:e.z.ZodIssueCode.invalid_intersection_types,message:"Invalid properties 'manufacturername' and 'modelid' should have the same type",path:["manufacturername","modelid"]})}function P(t,r,u){if(!t.bindings)return;const i=n=>`0x${(typeof n=="number"?n:Number.parseInt(n,16)).toString(16)}`,c={};t.bindings.forEach(n=>{n.bind==="unicast"&&n.report&&n.report.forEach(d=>{d.max!==65535&&(c[`${i(n["src.ep"])}.${i(n.cl)}.${i(d.at)}`]=d.max)})}),t.subdevices.forEach((n,d)=>{n.items.forEach((a,m)=>{var s;if(a["refresh.interval"]&&a.read&&a.read.fn==="zcl:attr"&&a.read.at){const o=i(a.read.ep??((s=n.fingerprint)==null?void 0:s.endpoint)??n.uuid[1]),p=Array.isArray(a.read.at)?a.read.at:[a.read.at];for(let h=0;h<p.length;h++){const z=`${o}.${i(a.read.cl)}.${i(p[h])}`;c[z]!==void 0&&a["refresh.interval"]-60<c[z]&&r.addIssue({code:e.z.ZodIssueCode.custom,message:`The refresh interval (${a["refresh.interval"]} - 60 = ${a["refresh.interval"]-60}) should be greater than the binding max refresh value (${c[z]}) with a margin of 60 seconds`,path:["subdevices",d,"items",m,"refresh.interval"]})}}})})}function W(t,r,u){const i=[{description:'a device with "state/ct" need the "min" and "max" values for capability.',if:{item:"state/ct"},need:{item:["cap/color/ct/min","cap/color/ct/max"]}},{description:'a device with "cap/color/ct/computes_xy" need the corresponding state/{x,y} items',if:{item:"cap/color/ct/computes_xy"},need:{item:["state/x","state/y","state/ct"]}},{description:'a device with "state/x" or "state/y" need the corresponding cap/color/xy/{red,green,blue}/{x,y} items',if:{item:{or:["state/x","state/y"]}},need:{item:["state/x","state/y","cap/color/xy/red_x","cap/color/xy/green_x","cap/color/xy/blue_x","cap/color/xy/red_y","cap/color/xy/green_y","cap/color/xy/blue_y"]}},{description:'a "(Extended) Color light" need ("state/x" and "state/y") or/and ("state/hue" and "state/sat") .',if:{type:{or:["$TYPE_EXTENDED_COLOR_LIGHT","Extended color light","$TYPE_COLOR_LIGHT","Color light"]}},need:{item:{or:[["state/x","state/y"],["state/hue","state/sat"]]}}}],c=(n,d)=>typeof n=="string"?d(n):Array.isArray(n)?n.every(a=>c(a,d)):"and"in n?n.and.every(a=>c(a,d)):"or"in n?n.or.some(a=>c(a,d)):!1;t.subdevices.forEach((n,d)=>{const a=n.items.map(m=>m.name);i.forEach(m=>{(Object.keys(m.if).length===0||Object.entries(m.if).some(([s,o])=>{switch(s){case"type":return c(o,p=>p===n.type);case"item":return c(o,p=>a.includes(p));default:return!1}}))&&(c(m.need.item,s=>a.includes(s))||r.addIssue({code:e.z.ZodIssueCode.custom,message:`The device is missing some items because ${m.description}`,path:["subdevices",d,"items"]}))})})}function L(t,r,u){const i=["parse","write"];t.subdevices.forEach((c,n)=>{c.items.forEach((d,a)=>{i.forEach(m=>{const s=d[m];s!==void 0&&(s.fn===void 0||s.fn==="zcl:attr"||s.fn==="zcl:cmd")&&(s.eval===void 0&&s.script===void 0&&r.addIssue({code:e.z.ZodIssueCode.custom,message:`The '${m}' function is missing 'eval' or 'script' option.`,path:["subdevices",n,"items",a,m]}),s.eval!==void 0&&s.script!==void 0&&r.addIssue({code:e.z.ZodIssueCode.custom,message:`The '${m}' function is having both 'eval' and 'script' option.`,path:["subdevices",n,"items",a,m]}))})})})}function N(t,r,u){const i=D();Object.keys(t).forEach(c=>{if(!Object.keys(i.shape).includes(c)){if(!["$MF_","$TYPE_"].some(n=>c.startsWith(n))){r.addIssue({code:e.z.ZodIssueCode.custom,message:"The constant key should start with '$MF_' or '$TYPE_'",path:[c]});return}typeof t[c]!="string"&&r.addIssue({code:e.z.ZodIssueCode.custom,message:"The constant value should be a string",path:[c]})}})}function R(t,r,u){t.subdevices.forEach((i,c)=>{const n=u.subDevices[i.type];if(!n){r.addIssue({code:e.z.ZodIssueCode.custom,message:`The device is missing the device definition (subdevice1.schema.json) for the type "${i.type}"`,path:["subdevices",c,"items"]});return}let d=n.items;n.items_optional&&(d=d.filter(a=>!n.items_optional.includes(a))),d.forEach(a=>{i.items.find(m=>m.name===a)||r.addIssue({code:e.z.ZodIssueCode.custom,message:`The device should have the item "${a}" because it is mandatory for devices of type "${i.type}"`,path:["subdevices",c,"items"]})})})}function Y(t,r,u){t.subdevices.forEach((i,c)=>{const n=i.items.map(d=>d.name);i.items.forEach((d,a)=>{d.parse&&d.parse.fn==="numtostr"&&(n.includes(d.parse.srcitem)||r.addIssue({code:e.z.ZodIssueCode.custom,message:`The device should have the item "${d.parse.srcitem}" because it is used in the 'numtostr' function`,path:["subdevices",c,"items",a,"parse","srcitem"]}))})})}function B(t){return e.z.strictObject({$schema:e.z.optional(e.z.string()),schema:e.z.literal("constants1.schema.json"),ddfvalidate:e.z.optional(e.z.boolean()),manufacturers:e.z.record(e.z.string().startsWith("$MF_"),e.z.string()),"device-types":e.z.record(e.z.string().startsWith("$TYPE_"),e.z.string())})}function D(t){return e.z.object({$schema:e.z.optional(e.z.string()),schema:e.z.literal("constants2.schema.json"),ddfvalidate:e.z.optional(e.z.boolean())}).passthrough()}function U(){return e.z.string().regex(/^(\d{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])$/,"Invalid date value")}function l(t=void 0){const r="Invalid hexadecimal value";return t===void 0?e.z.string().regex(/^0x[0-9a-fA-F]+$/,r):e.z.string().regex(new RegExp(`^0x[0-9a-fA-F]{${t}}$`),r)}function v(){return e.z.union([l(2),e.z.number().min(0).max(255)])}function k(){return e.z.custom(t=>{if(!Array.isArray(t)||t.length%2!==0)return!1;for(let r=0;r<t.length;r+=2){const u=t[r],i=t[r+1];if(typeof u!="number"||typeof i!="string")return!1}return!0},"The value must be an array with an even number of values and alternating between number and string.")}function S(){return e.z.union([e.z.tuple([e.z.literal("$address.ext"),l(2)]),e.z.tuple([e.z.literal("$address.ext"),l(2),l(4)])])}function C(){return e.z.string()}function A(){return e.z.string()}const y=e.z.strictObject({ep:e.z.optional(v()).describe("Endpoint, 255 means any endpoint, 0 means auto selected from subdevice."),cl:l(4).describe("Cluster ID."),at:e.z.optional(l(4).or(e.z.array(l(4)))).describe("Attribute ID."),mf:e.z.optional(l(4)).describe("Manufacturer code, must be set to 0x0000 for non manufacturer specific commands."),cmd:e.z.optional(e.z.union([e.z.literal("any"),l(2)])).describe("Zigbee command."),fc:e.z.optional(l(2).or(e.z.number())).describe("Zigbee command frame control."),eval:e.z.optional(A()).describe("Javascript expression to transform the attribute value to the Item value."),script:e.z.optional(C()).describe("Relative path of a Javascript .js file.")}),f={read:y.extend({}),parse:y.extend({}),write:y.extend({"state.timeout":e.z.optional(e.z.number()),"change.timeout":e.z.optional(e.z.number()),dt:e.z.optional(l(2)).describe("Data type.")})};function V(){return e.z.discriminatedUnion("fn",[e.z.strictObject({fn:e.z.literal("none")}),f.read.extend({fn:e.z.undefined().describe("Generic function to read ZCL attributes.")}),f.read.extend({fn:e.z.literal("zcl:attr").describe("Generic function to parse ZCL values from read/report commands.")}),f.read.extend({fn:e.z.literal("zcl:cmd").describe("Generic function to parse ZCL values from read/report commands.")}),e.z.strictObject({fn:e.z.literal("tuya").describe("Generic function to read all Tuya datapoints. It has no parameters.")})]).refine(t=>!("eval"in t&&"script"in t),{message:"eval and script should not both be present"})}function q(t){return e.z.discriminatedUnion("fn",[f.parse.extend({fn:e.z.undefined().describe("Generic function to read ZCL attributes."),cppsrc:e.z.optional(e.z.string())}),f.parse.extend({fn:e.z.literal("zcl:attr").describe("Generic function to parse ZCL values from read/report commands.")}),f.parse.extend({fn:e.z.literal("zcl:cmd").describe("Generic function to parse ZCL values from read/report commands.")}),e.z.strictObject({fn:e.z.literal("ias:zonestatus").describe("Generic function to parse IAS ZONE status change notifications or zone status from read/report command."),mask:e.z.optional(e.z.enum(["alarm1","alarm2"]).or(e.z.literal("alarm1,alarm2"))).describe("Sets the bitmask for Alert1 and Alert2 item of the IAS Zone status.")}),e.z.strictObject({fn:e.z.literal("numtostr").describe("Generic function to to convert number to string."),srcitem:e.z.enum(t.attributes,{errorMap:(r,u)=>r.code==="invalid_enum_value"?{message:`Invalid enum value. Expected item from generic attributes definition, received '${r.received}'`}:{message:u.defaultError}}).describe("The source item holding the number."),op:e.z.enum(["lt","le","eq","gt","ge"]).describe("Comparison operator (lt | le | eq | gt | ge)"),to:k().describe("Array of (num, string) mappings")}),e.z.strictObject({fn:e.z.literal("time").describe("Specialized function to parse time, local and last set time from read/report commands of the time cluster and auto-sync time if needed.")}),f.parse.pick({ep:!0,at:!0,mf:!0,eval:!0,script:!0}).extend({fn:e.z.literal("xiaomi:special").describe("Generic function to parse custom Xiaomi attributes and commands."),idx:l(2).describe("A 8-bit string hex value.")}),f.parse.pick({eval:!0,script:!0}).extend({fn:e.z.literal("tuya").describe("Generic function to parse Tuya data."),dpid:e.z.number().describe("Data point ID. 1-255 the datapoint ID.")})]).refine(r=>!("eval"in r&&"script"in r),{message:"eval and script should not both be present"})}function H(){return e.z.discriminatedUnion("fn",[e.z.strictObject({fn:e.z.literal("none")}),f.write.extend({fn:e.z.undefined().describe("Generic function to read ZCL attributes."),cppsrc:e.z.optional(e.z.string())}),f.write.extend({fn:e.z.literal("zcl:attr").describe("Generic function to parse ZCL values from read/report commands.")}),f.write.extend({fn:e.z.literal("zcl:cmd").describe("Generic function to parse ZCL values from read/report commands.")}),f.write.pick({eval:!0,script:!0}).extend({fn:e.z.literal("tuya").describe("Generic function to write Tuya data."),dpid:e.z.number().describe("Data point ID. 1-255 the datapoint ID."),dt:l(2).describe("Data type.")})]).refine(t=>!("eval"in t&&"script"in t),{message:"eval and script should not both be present"})}function F(t){return e.z.strictObject({$schema:e.z.optional(e.z.string()),schema:e.z.literal("resourceitem1.schema.json"),id:e.z.string(),ddfvalidate:e.z.optional(e.z.boolean()),description:e.z.optional(e.z.string()).describe("Item description, better to do not use it."),comment:e.z.optional(e.z.string()).describe("TODO: What is this ? What the difference with description ?"),deprecated:e.z.optional(U()).describe("Date of deprecation, if the item is deprecated, it's better to use the new one."),datatype:e.z.optional(e.z.enum(["String","Bool","Int8","Int16","Int32","Int64","UInt8","UInt16","UInt32","UInt64","Double","Array","Array[3]","ISO 8601 timestamp"])).describe("Data type of the item."),access:e.z.optional(e.z.enum(["R","W","RW"])).describe("Access mode for this item, some of them are not editable."),public:e.z.optional(e.z.boolean()).describe("Item visible on the API."),implicit:e.z.optional(e.z.boolean()).describe("TODO: What is this ?"),managed:e.z.optional(e.z.boolean()).describe("TODO: What is this ?"),awake:e.z.optional(e.z.boolean()).describe("The device is considered awake when this item is set due a incoming command."),static:e.z.optional(e.z.union([e.z.string(),e.z.number(),e.z.boolean()])).describe("A static default value is fixed and can be not changed."),range:e.z.optional(e.z.tuple([e.z.number(),e.z.number()])).describe("Values range limit."),virtual:e.z.optional(e.z.boolean()).describe("TODO: What is this ?"),read:e.z.optional(V()).describe("Fonction used to read value."),parse:e.z.optional(q(t)).describe("Fonction used to parse incoming values."),write:e.z.optional(H()).describe("Fonction used to write value."),"refresh.interval":e.z.optional(e.z.number()).describe("Refresh interval used for read fonction, NEED to be superior at value used in binding part."),values:e.z.optional(e.z.unknown()).describe("TODO: What is this ?"),default:e.z.optional(e.z.unknown()).describe("Defaut value.")})}function J(t){return e.z.strictObject({$schema:e.z.optional(e.z.string()),schema:e.z.literal("devcap1.schema.json"),uuid:e.z.optional(e.z.string()),ddfvalidate:e.z.optional(e.z.boolean()),version:e.z.optional(e.z.string()),version_deconz:e.z.optional(e.z.string()),"doc:path":e.z.optional(e.z.string()),"doc:hdr":e.z.optional(e.z.string()),"md:changelogs":e.z.optional(e.z.array(e.z.string())).describe("Changelogs for this device, markdown file."),"md:info":e.z.optional(e.z.array(e.z.string())).describe("Notes info for this device, markdown file."),"md:warning":e.z.optional(e.z.array(e.z.string())).describe("Notes warning for this device, markdown file."),"md:known_issues":e.z.optional(e.z.array(e.z.string())).describe("Know issues for this device, markdown file."),manufacturername:e.z.union([e.z.enum(Object.keys(t.manufacturers)),e.z.string().regex(/^(?!\$MF_).*/g,"The manufacturer name start with $MF_ but is not present in constants.json"),e.z.array(e.z.union([e.z.enum(Object.keys(t.manufacturers)),e.z.string().regex(/^(?!\$MF_).*/g,"The manufacturer name start with $MF_ but is not present in constants.json")]))]).describe("Manufacturer name from Basic Cluster."),modelid:e.z.string().or(e.z.array(e.z.string())).describe("Model ID from Basic Cluster."),vendor:e.z.optional(e.z.string()).describe("Friendly name of the manufacturer."),product:e.z.optional(e.z.string()).describe("Friendly name of the product."),comment:e.z.optional(e.z.string()),matchexpr:e.z.optional(A()).describe("Need to return true for the DDF be used."),path:e.z.optional(C()).describe("DDF path, useless, can be removed."),sleeper:e.z.optional(e.z.boolean()).describe("Sleeping devices can only receive when awake."),supportsMgmtBind:e.z.optional(e.z.boolean()),status:e.z.enum(["Draft","Bronze","Silver","Gold"]).describe("The code quality of the DDF file."),subdevices:e.z.array(X(t)).describe("Devices section."),bindings:e.z.optional(e.z.array(Q())).describe("Bindings section.")})}function X(t){return e.z.strictObject({type:e.z.union([e.z.enum(Object.keys(t.deviceTypes),{errorMap:(r,u)=>r.code==="invalid_enum_value"?{message:`Invalid enum value. Expected type from generic attributes definition, received '${r.received}'`}:{message:u.defaultError}}),e.z.string().regex(/^(?!\$TYPE_).*/g,"The type start with $TYPE_ but is not present in constants.json")]),restapi:e.z.enum(["/lights","/sensors"]),uuid:S(),fingerprint:e.z.optional(e.z.strictObject({profile:l(4),device:l(4),endpoint:v(),in:e.z.optional(e.z.array(l(4))),out:e.z.optional(e.z.array(l(4)))})),meta:e.z.optional(e.z.strictObject({values:e.z.any(),"group.endpoints":e.z.optional(e.z.array(e.z.number()))})),buttons:e.z.optional(e.z.any()),buttonevents:e.z.optional(e.z.any()),items:e.z.array(K(t)),example:e.z.optional(e.z.unknown())})}function K(t){return F(t).omit({$schema:!0,schema:!0,id:!0}).extend({name:e.z.enum(t.attributes,{errorMap:(r,u)=>r.code==="invalid_enum_value"?{message:`Invalid enum value. Expected item from generic attributes definition, received '${r.received}'`}:{message:u.defaultError}}).describe("Item name.")})}function Q(t){return e.z.discriminatedUnion("bind",[e.z.strictObject({bind:e.z.literal("unicast"),"src.ep":v().describe("Source endpoint."),"dst.ep":e.z.optional(v()).describe("Destination endpoint, generaly 0x01."),cl:l(4).describe("Cluster."),report:e.z.optional(e.z.array(e.z.strictObject({at:l(4),dt:l(2),mf:e.z.optional(l(4)),min:e.z.number(),max:e.z.number(),change:e.z.optional(l().or(e.z.number()))}).refine(r=>r.min<=r.max,{message:"invalid report time, min should be smaller than max"})))}),e.z.strictObject({bind:e.z.literal("groupcast"),"src.ep":v().describe("Source endpoint."),cl:l(4).describe("Cluster."),"config.group":e.z.number().min(0).max(255)})])}function ee(t){const r=e.z.array(e.z.enum(t.attributes,{errorMap:(u,i)=>u.code==="invalid_enum_value"?{message:`Invalid enum value. Expected item from generic attributes definition, received '${u.received}'`}:{message:i.defaultError}}));return e.z.strictObject({$schema:e.z.optional(e.z.string()),schema:e.z.literal("subdevice1.schema.json"),ddfvalidate:e.z.optional(e.z.boolean()),type:e.z.union([e.z.enum(Object.keys(t.deviceTypes),{errorMap:(u,i)=>u.code==="invalid_enum_value"?{message:`Invalid enum value. Expected type from generic attributes definition, received '${u.received}'`}:{message:i.defaultError}}),e.z.string().regex(/^(?!\$TYPE_).*/g,"The type start with $TYPE_ but is not present in constants.json")]),name:e.z.string(),ui_name:e.z.string().max(64),restapi:e.z.enum(["/lights","/sensors"]),order:e.z.number(),uuid:S(),items:r,items_optional:e.z.optional(r)})}function O(t){return e.z.discriminatedUnion("schema",[J(t),B(),D(),F(t),ee(t)]).superRefine((r,u)=>{switch(r.schema){case"devcap1.schema.json":w[r.schema].map(i=>i(r,u,t));break;case"constants2.schema.json":w[r.schema].map(i=>i(r,u,t));break}})}function te(t={attributes:[],manufacturers:{},deviceTypes:{},resources:{},subDevices:{}}){let r=O(t);const u=()=>{r=O(t)},i=m=>["constants1.schema.json","constants2.schema.json","resourceitem1.schema.json","subdevice1.schema.json"].includes(m),c=m=>m==="devcap1.schema.json",n=m=>{const s=r.parse(m);switch(s.schema){case"constants1.schema.json":t.manufacturers={...t.manufacturers,...s.manufacturers},t.deviceTypes={...t.deviceTypes,...s["device-types"]};break;case"constants2.schema.json":{Object.keys(s).filter(o=>o.startsWith("$MF_")).forEach(o=>{t.manufacturers[o]=s[o]}),Object.keys(s).filter(o=>o.startsWith("$TYPE_")).forEach(o=>{t.deviceTypes[o]=s[o]});break}case"resourceitem1.schema.json":{if(t.attributes.includes(s.id))throw new Error(`Got duplicate resource item with attribute id '${s.id}'.`);const o=s,p=s.id;delete o.$schema,delete o.schema,delete o.id,t.resources[p]=o,t.attributes.push(p);break}case"subdevice1.schema.json":t.subDevices[s.type]=s,t.subDevices[s.name]=s;break;default:throw new Error(`Got invalid generic file, got data with schema '${s.schema}'.`)}return u(),!0},d=m=>r.parse(m);return{generics:t,loadGeneric:n,validate:d,bulkValidate:(m,s,o={})=>{const p=(h,z)=>{var $,j,E;let x=0,I=Number.POSITIVE_INFINITY,_=h,b=[];for(($=o.onSectionStart)==null||$.call(o,z,h.length);b=[],(j=o.onSectionProgress)==null||j.call(o,z,1,h.length),_.forEach(g=>{var T;(T=o.onSectionProgress)==null||T.call(o,z,x++,h.length);try{z==="generic"?n(g.data):z==="ddf"&&d(g.data)}catch(Z){b.push({...g,error:Z})}}),!(b.length===0||b.length>=I);)x-=b.length,_=b,I=b.length;return(E=o.onSectionEnd)==null||E.call(o,z,h.length,b),b};return[...p(m,"generic"),...p(s,"ddf")]},getSchema:()=>r,version:G,isGeneric:i,isDDF:c}}exports.createValidator=te;
@@ -1,701 +1,6 @@
1
1
  import { ZodType, ZodError } from "zod";
2
2
 
3
- export type DDF = {
4
- $schema?: string | undefined;
5
- schema: "devcap1.schema.json";
6
- uuid?: string | undefined;
7
- ddfvalidate?: boolean | undefined;
8
- version?: string | undefined;
9
- version_deconz?: string | undefined;
10
- "doc:path"?: string | undefined;
11
- "doc:hdr"?: string | undefined;
12
- /** Changelogs for this device, markdown file. */
13
- "md:changelogs"?: string[] | undefined;
14
- /** Notes info for this device, markdown file. */
15
- "md:info"?: string[] | undefined;
16
- /** Notes warning for this device, markdown file. */
17
- "md:warning"?: string[] | undefined;
18
- /** Know issues for this device, markdown file. */
19
- "md:known_issues"?: string[] | undefined;
20
- /** Manufacturer name from Basic Cluster. */
21
- manufacturername: ("$MF_AQARA" | "$MF_BOSCH" | "$MF_IKEA" | "$MF_LUMI" | "$MF_LUTRON" | "$MF_PHILIPS" | "$MF_SAMJIN" | "$MF_SIGNIFY" | "$MF_TUYA" | "$MF_XIAOMI") | string | (("$MF_AQARA" | "$MF_BOSCH" | "$MF_IKEA" | "$MF_LUMI" | "$MF_LUTRON" | "$MF_PHILIPS" | "$MF_SAMJIN" | "$MF_SIGNIFY" | "$MF_TUYA" | "$MF_XIAOMI") | string)[];
22
- /** Model ID from Basic Cluster. */
23
- modelid: string | string[];
24
- /** Friendly name of the manufacturer. */
25
- vendor?: string | undefined;
26
- /** Friendly name of the product. */
27
- product?: string | undefined;
28
- comment?: string | undefined;
29
- /** Need to return true for the DDF be used. */
30
- matchexpr?: string | undefined;
31
- /** DDF path, useless, can be removed. */
32
- path?: string | undefined;
33
- /** Sleeping devices can only receive when awake. */
34
- sleeper?: boolean | undefined;
35
- supportsMgmtBind?: boolean | undefined;
36
- /** The code quality of the DDF file. */
37
- status: "Draft" | "Bronze" | "Silver" | "Gold";
38
- /** Devices section. */
39
- subdevices: {
40
- type: ("$TYPE_AIR_PURIFIER" | "$TYPE_AIR_QUALITY_SENSOR" | "$TYPE_CARBONDIOXIDE_SENSOR" | "$TYPE_CARBONMONOXIDE_SENSOR" | "$TYPE_FORMALDEHYDE_SENSOR" | "$TYPE_PARTICULATEMATTER_SENSOR" | "$TYPE_ALARM_SENSOR" | "$TYPE_ANCILLARY_CONTROL" | "$TYPE_BATTERY_SENSOR" | "$TYPE_COLOR_LIGHT" | "$TYPE_COLOR_TEMPERATURE_LIGHT" | "$TYPE_CONSUMPTION_SENSOR" | "$TYPE_DIMMABLE_LIGHT" | "$TYPE_DIMMABLE_PLUGIN_UNIT" | "$TYPE_DIMMER_SWITCH" | "$TYPE_DOOR_LOCK" | "$TYPE_DOOR_LOCK_CONTROLLER" | "$TYPE_DOOR_LOCK_SENSOR" | "$TYPE_EXTENDED_COLOR_LIGHT" | "$TYPE_FIRE_SENSOR" | "$TYPE_HUMIDITY_SENSOR" | "$TYPE_LEVEL_CONTROL_SWITCH" | "$TYPE_LIGHT_LEVEL_SENSOR" | "$TYPE_MOISTURE_SENSOR" | "$TYPE_ON_OFF_LIGHT" | "$TYPE_ON_OFF_LIGHT_SWITCH" | "$TYPE_ON_OFF_OUTPUT" | "$TYPE_ON_OFF_PLUGIN_UNIT" | "$TYPE_ON_OFF_SWITCH" | "$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;
41
- restapi: "/lights" | "/sensors";
42
- uuid: [
43
- "$address.ext",
44
- string
45
- ] | [
46
- "$address.ext",
47
- string,
48
- string
49
- ];
50
- fingerprint?: {
51
- profile: string;
52
- device: string;
53
- endpoint: string | number;
54
- in?: string[] | undefined;
55
- out?: string[] | undefined;
56
- } | undefined;
57
- meta?: {
58
- values?: any;
59
- "group.endpoints"?: number[] | undefined;
60
- } | undefined;
61
- buttons?: any | undefined;
62
- buttonevents?: any | undefined;
63
- items: {
64
- ddfvalidate?: boolean | undefined;
65
- /** Item description, better to do not use it. */
66
- description?: string | undefined;
67
- /** TODO: What is this ? What the difference with description ? */
68
- comment?: string | undefined;
69
- /** Date of deprecation, if the item is deprecated, it's better to use the new one. */
70
- deprecated?: string | undefined;
71
- /** Data type of the item. */
72
- datatype?: ("String" | "Bool" | "Int8" | "Int16" | "Int32" | "Int64" | "UInt8" | "UInt16" | "UInt32" | "UInt64" | "Double" | "Array" | "Array[3]" | "ISO 8601 timestamp") | undefined;
73
- /** Access mode for this item, some of them are not editable. */
74
- access?: ("R" | "W" | "RW") | undefined;
75
- /** Item visible on the API. */
76
- public?: boolean | undefined;
77
- /** TODO: What is this ? */
78
- implicit?: boolean | undefined;
79
- /** TODO: What is this ? */
80
- managed?: boolean | undefined;
81
- /** The device is considered awake when this item is set due a incoming command. */
82
- awake?: boolean | undefined;
83
- /** A static default value is fixed and can be not changed. */
84
- static?: (string | number | boolean) | undefined;
85
- /** Values range limit. */
86
- range?: [
87
- number,
88
- number
89
- ] | undefined;
90
- /** TODO: What is this ? */
91
- virtual?: boolean | undefined;
92
- /** Fonction used to read value. */
93
- read?: ({
94
- fn: "none";
95
- } | {
96
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
97
- ep?: (string | number) | undefined;
98
- /** Cluster ID. */
99
- cl: string;
100
- /** Attribute ID. */
101
- at?: (string | string[]) | undefined;
102
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
103
- mf?: string | undefined;
104
- /** Zigbee command. */
105
- cmd?: ("any" | string) | undefined;
106
- /** Zigbee command frame control. */
107
- fc?: (string | number) | undefined;
108
- /** Javascript expression to transform the attribute value to the Item value. */
109
- eval?: string | undefined;
110
- /** Relative path of a Javascript .js file. */
111
- script?: string | undefined;
112
- /** Generic function to read ZCL attributes. */
113
- fn?: undefined;
114
- } | {
115
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
116
- ep?: (string | number) | undefined;
117
- /** Cluster ID. */
118
- cl: string;
119
- /** Attribute ID. */
120
- at?: (string | string[]) | undefined;
121
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
122
- mf?: string | undefined;
123
- /** Zigbee command. */
124
- cmd?: ("any" | string) | undefined;
125
- /** Zigbee command frame control. */
126
- fc?: (string | number) | undefined;
127
- /** Javascript expression to transform the attribute value to the Item value. */
128
- eval?: string | undefined;
129
- /** Relative path of a Javascript .js file. */
130
- script?: string | undefined;
131
- /** Generic function to parse ZCL values from read/report commands. */
132
- fn: "zcl:attr";
133
- } | {
134
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
135
- ep?: (string | number) | undefined;
136
- /** Cluster ID. */
137
- cl: string;
138
- /** Attribute ID. */
139
- at?: (string | string[]) | undefined;
140
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
141
- mf?: string | undefined;
142
- /** Zigbee command. */
143
- cmd?: ("any" | string) | undefined;
144
- /** Zigbee command frame control. */
145
- fc?: (string | number) | undefined;
146
- /** Javascript expression to transform the attribute value to the Item value. */
147
- eval?: string | undefined;
148
- /** Relative path of a Javascript .js file. */
149
- script?: string | undefined;
150
- /** Generic function to parse ZCL values from read/report commands. */
151
- fn: "zcl:cmd";
152
- } | {
153
- /** Generic function to read all Tuya datapoints. It has no parameters. */
154
- fn: "tuya";
155
- }) | undefined;
156
- /** Fonction used to parse incoming values. */
157
- parse?: ({
158
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
159
- ep?: (string | number) | undefined;
160
- /** Cluster ID. */
161
- cl: string;
162
- /** Attribute ID. */
163
- at?: (string | string[]) | undefined;
164
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
165
- mf?: string | undefined;
166
- /** Zigbee command. */
167
- cmd?: ("any" | string) | undefined;
168
- /** Zigbee command frame control. */
169
- fc?: (string | number) | undefined;
170
- /** Javascript expression to transform the attribute value to the Item value. */
171
- eval?: string | undefined;
172
- /** Relative path of a Javascript .js file. */
173
- script?: string | undefined;
174
- /** Generic function to read ZCL attributes. */
175
- fn?: undefined;
176
- cppsrc?: string | undefined;
177
- } | {
178
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
179
- ep?: (string | number) | undefined;
180
- /** Cluster ID. */
181
- cl: string;
182
- /** Attribute ID. */
183
- at?: (string | string[]) | undefined;
184
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
185
- mf?: string | undefined;
186
- /** Zigbee command. */
187
- cmd?: ("any" | string) | undefined;
188
- /** Zigbee command frame control. */
189
- fc?: (string | number) | undefined;
190
- /** Javascript expression to transform the attribute value to the Item value. */
191
- eval?: string | undefined;
192
- /** Relative path of a Javascript .js file. */
193
- script?: string | undefined;
194
- /** Generic function to parse ZCL values from read/report commands. */
195
- fn: "zcl:attr";
196
- } | {
197
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
198
- ep?: (string | number) | undefined;
199
- /** Cluster ID. */
200
- cl: string;
201
- /** Attribute ID. */
202
- at?: (string | string[]) | undefined;
203
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
204
- mf?: string | undefined;
205
- /** Zigbee command. */
206
- cmd?: ("any" | string) | undefined;
207
- /** Zigbee command frame control. */
208
- fc?: (string | number) | 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;
213
- /** Generic function to parse ZCL values from read/report commands. */
214
- fn: "zcl:cmd";
215
- } | {
216
- /** Generic function to parse IAS ZONE status change notifications or zone status from read/report command. */
217
- fn: "ias:zonestatus";
218
- /** Sets the bitmask for Alert1 and Alert2 item of the IAS Zone status. */
219
- mask?: (("alarm1" | "alarm2") | "alarm1,alarm2") | undefined;
220
- } | {
221
- /** Generic function to to convert number to string. */
222
- fn: "numtostr";
223
- /** The source item holding the number. */
224
- srcitem: "state/y" | "state/x" | "state/windowopen" | "state/water" | "state/water_bis" | "state/voltage" | "state/vibrationstrength" | "state/vibration" | "state/valve" | "state/utc" | "state/tiltangle" | "state/tilt" | "state/test" | "state/temperature" | "state/temperature_bis" | "state/targetdistance" | "state/tampered" | "state/speed" | "state/seconds_remaining" | "state/sat" | "state/rotaryevent" | "state/replacefilter" | "state/reachable" | "state/production" | "state/pressure" | "state/pressure_bis" | "state/presenceevent" | "state/presence" | "state/power" | "state/pm2_5" | "state/panel" | "state/orientation_z" | "state/orientation_y" | "state/orientation_x" | "state/open" | "state/open_bis" | "state/on" | "state/music_sync" | "state/mountingmodeactive" | "state/moisture" | "state/measured_value" | "state/lux" | "state/lowbattery" | "state/lockstate" | "state/localtime" | "state/lightlevel" | "state/lift" | "state/lastupdated" | "state/lastset" | "state/lastcheckin" | "state/humidity" | "state/humidity_bis" | "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_P3" | "state/current_P2" | "state/current_P1" | "state/current" | "state/ct" | "state/consumption" | "state/consumption_2" | "state/colormode" | "state/charging" | "state/carbonmonoxide" | "state/buttonevent" | "state/bri" | "state/battery" | "state/angle" | "state/alert" | "state/alarm" | "state/airqualityppb" | "state/airqualityppb_bis" | "state/airquality" | "state/airquality_bis" | "state/action" | "config/windowopen_set" | "config/windowcoveringtype" | "config/volume" | "config/usertest" | "config/unoccupiedheatsetpoint" | "config/tuya_unlock" | "config/triggerdistance" | "config/triggerdistance_bis" | "config/tholdoffset" | "config/tholddark" | "config/temperature" | "config/swingmode" | "config/speed" | "config/sensitivitymax" | "config/sensitivity" | "config/sensitivity_bis" | "config/selftest" | "config/schedule_on" | "config/schedule" | "config/reversed" | "config/resetpresence" | "config/reportgrid" | "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/fadingtime" | "config/externalwindowopen" | "config/externalsensortemp" | "config/enrolled" | "config/duration" | "config/displayflipped" | "config/devicemode" | "config/devicemode_bis" | "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/gradient/pixel_count" | "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/battery_bis" | "config/allowtouchlink" | "config/alert" | "cap/transition_block" | "cap/sleeper" | "cap/on/off_with_effect" | "cap/measured_value/unit" | "cap/measured_value/substance" | "cap/measured_value/quantity" | "cap/measured_value/min" | "cap/measured_value/max" | "cap/groups/not_supported" | "cap/group" | "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/swversion_bis" | "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";
225
- /** Comparison operator (lt | le | eq | gt | ge) */
226
- op: "lt" | "le" | "eq" | "gt" | "ge";
227
- /** Array of (num, string) mappings */
228
- to: any;
229
- } | {
230
- /** Specialized function to parse time, local and last set time from read/report commands of the time cluster and auto-sync time if needed. */
231
- fn: "time";
232
- } | {
233
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
234
- ep?: (string | number) | undefined;
235
- /** Attribute ID. */
236
- at?: (string | string[]) | undefined;
237
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
238
- mf?: string | undefined;
239
- /** Javascript expression to transform the attribute value to the Item value. */
240
- eval?: string | undefined;
241
- /** Relative path of a Javascript .js file. */
242
- script?: string | undefined;
243
- /** Generic function to parse custom Xiaomi attributes and commands. */
244
- fn: "xiaomi:special";
245
- /** A 8-bit string hex value. */
246
- idx: string;
247
- } | {
248
- /** Javascript expression to transform the attribute value to the Item value. */
249
- eval?: string | undefined;
250
- /** Relative path of a Javascript .js file. */
251
- script?: string | undefined;
252
- /** Generic function to parse Tuya data. */
253
- fn: "tuya";
254
- /** Data point ID. 1-255 the datapoint ID. */
255
- dpid: number;
256
- }) | undefined;
257
- /** Fonction used to write value. */
258
- write?: ({
259
- fn: "none";
260
- } | {
261
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
262
- ep?: (string | number) | undefined;
263
- /** Cluster ID. */
264
- cl: string;
265
- /** Attribute ID. */
266
- at?: (string | string[]) | undefined;
267
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
268
- mf?: string | undefined;
269
- /** Zigbee command. */
270
- cmd?: ("any" | string) | undefined;
271
- /** Zigbee command frame control. */
272
- fc?: (string | number) | undefined;
273
- /** Javascript expression to transform the attribute value to the Item value. */
274
- eval?: string | undefined;
275
- /** Relative path of a Javascript .js file. */
276
- script?: string | undefined;
277
- "state.timeout"?: number | undefined;
278
- "change.timeout"?: number | undefined;
279
- /** Data type. */
280
- dt?: string | undefined;
281
- /** Generic function to read ZCL attributes. */
282
- fn?: undefined;
283
- cppsrc?: string | undefined;
284
- } | {
285
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
286
- ep?: (string | number) | undefined;
287
- /** Cluster ID. */
288
- cl: string;
289
- /** Attribute ID. */
290
- at?: (string | string[]) | undefined;
291
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
292
- mf?: string | undefined;
293
- /** Zigbee command. */
294
- cmd?: ("any" | string) | undefined;
295
- /** Zigbee command frame control. */
296
- fc?: (string | number) | undefined;
297
- /** Javascript expression to transform the attribute value to the Item value. */
298
- eval?: string | undefined;
299
- /** Relative path of a Javascript .js file. */
300
- script?: string | undefined;
301
- "state.timeout"?: number | undefined;
302
- "change.timeout"?: number | undefined;
303
- /** Data type. */
304
- dt?: string | undefined;
305
- /** Generic function to parse ZCL values from read/report commands. */
306
- fn: "zcl:attr";
307
- } | {
308
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
309
- ep?: (string | number) | undefined;
310
- /** Cluster ID. */
311
- cl: string;
312
- /** Attribute ID. */
313
- at?: (string | string[]) | undefined;
314
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
315
- mf?: string | undefined;
316
- /** Zigbee command. */
317
- cmd?: ("any" | string) | undefined;
318
- /** Zigbee command frame control. */
319
- fc?: (string | number) | undefined;
320
- /** Javascript expression to transform the attribute value to the Item value. */
321
- eval?: string | undefined;
322
- /** Relative path of a Javascript .js file. */
323
- script?: string | undefined;
324
- "state.timeout"?: number | undefined;
325
- "change.timeout"?: number | undefined;
326
- /** Data type. */
327
- dt?: string | undefined;
328
- /** Generic function to parse ZCL values from read/report commands. */
329
- fn: "zcl:cmd";
330
- } | {
331
- /** Javascript expression to transform the attribute value to the Item value. */
332
- eval?: string | undefined;
333
- /** Relative path of a Javascript .js file. */
334
- script?: string | undefined;
335
- /** Generic function to write Tuya data. */
336
- fn: "tuya";
337
- /** Data point ID. 1-255 the datapoint ID. */
338
- dpid: number;
339
- /** Data type. */
340
- dt: string;
341
- }) | undefined;
342
- /** Refresh interval used for read fonction, NEED to be superior at value used in binding part. */
343
- "refresh.interval"?: number | undefined;
344
- /** TODO: What is this ? */
345
- values?: unknown | undefined;
346
- /** Defaut value. */
347
- default?: unknown | undefined;
348
- /** Item name. */
349
- name: "state/y" | "state/x" | "state/windowopen" | "state/water" | "state/water_bis" | "state/voltage" | "state/vibrationstrength" | "state/vibration" | "state/valve" | "state/utc" | "state/tiltangle" | "state/tilt" | "state/test" | "state/temperature" | "state/temperature_bis" | "state/targetdistance" | "state/tampered" | "state/speed" | "state/seconds_remaining" | "state/sat" | "state/rotaryevent" | "state/replacefilter" | "state/reachable" | "state/production" | "state/pressure" | "state/pressure_bis" | "state/presenceevent" | "state/presence" | "state/power" | "state/pm2_5" | "state/panel" | "state/orientation_z" | "state/orientation_y" | "state/orientation_x" | "state/open" | "state/open_bis" | "state/on" | "state/music_sync" | "state/mountingmodeactive" | "state/moisture" | "state/measured_value" | "state/lux" | "state/lowbattery" | "state/lockstate" | "state/localtime" | "state/lightlevel" | "state/lift" | "state/lastupdated" | "state/lastset" | "state/lastcheckin" | "state/humidity" | "state/humidity_bis" | "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_P3" | "state/current_P2" | "state/current_P1" | "state/current" | "state/ct" | "state/consumption" | "state/consumption_2" | "state/colormode" | "state/charging" | "state/carbonmonoxide" | "state/buttonevent" | "state/bri" | "state/battery" | "state/angle" | "state/alert" | "state/alarm" | "state/airqualityppb" | "state/airqualityppb_bis" | "state/airquality" | "state/airquality_bis" | "state/action" | "config/windowopen_set" | "config/windowcoveringtype" | "config/volume" | "config/usertest" | "config/unoccupiedheatsetpoint" | "config/tuya_unlock" | "config/triggerdistance" | "config/triggerdistance_bis" | "config/tholdoffset" | "config/tholddark" | "config/temperature" | "config/swingmode" | "config/speed" | "config/sensitivitymax" | "config/sensitivity" | "config/sensitivity_bis" | "config/selftest" | "config/schedule_on" | "config/schedule" | "config/reversed" | "config/resetpresence" | "config/reportgrid" | "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/fadingtime" | "config/externalwindowopen" | "config/externalsensortemp" | "config/enrolled" | "config/duration" | "config/displayflipped" | "config/devicemode" | "config/devicemode_bis" | "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/gradient/pixel_count" | "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/battery_bis" | "config/allowtouchlink" | "config/alert" | "cap/transition_block" | "cap/sleeper" | "cap/on/off_with_effect" | "cap/measured_value/unit" | "cap/measured_value/substance" | "cap/measured_value/quantity" | "cap/measured_value/min" | "cap/measured_value/max" | "cap/groups/not_supported" | "cap/group" | "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/swversion_bis" | "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";
350
- }[];
351
- example?: unknown | undefined;
352
- }[];
353
- /** Bindings section. */
354
- bindings?: ({
355
- bind: "unicast";
356
- /** Source endpoint. */
357
- "src.ep": string | number;
358
- /** Destination endpoint, generaly 0x01. */
359
- "dst.ep"?: (string | number) | undefined;
360
- /** Cluster. */
361
- cl: string;
362
- report?: {
363
- at: string;
364
- dt: string;
365
- mf?: string | undefined;
366
- min: number;
367
- max: number;
368
- change?: (string | number) | undefined;
369
- }[] | undefined;
370
- } | {
371
- bind: "groupcast";
372
- /** Source endpoint. */
373
- "src.ep": string | number;
374
- /** Cluster. */
375
- cl: string;
376
- "config.group": number;
377
- })[] | undefined;
378
- } | {
379
- $schema?: string | undefined;
380
- schema: "constants1.schema.json";
381
- ddfvalidate?: boolean | undefined;
382
- manufacturers: {
383
- [x: string]: string;
384
- };
385
- "device-types": {
386
- [x: string]: string;
387
- };
388
- } | {
389
- $schema?: string | undefined;
390
- schema: "constants2.schema.json";
391
- ddfvalidate?: boolean | undefined;
392
- } | {
393
- $schema?: string | undefined;
394
- schema: "resourceitem1.schema.json";
395
- id: string;
396
- ddfvalidate?: boolean | undefined;
397
- /** Item description, better to do not use it. */
398
- description?: string | undefined;
399
- /** TODO: What is this ? What the difference with description ? */
400
- comment?: string | undefined;
401
- /** Date of deprecation, if the item is deprecated, it's better to use the new one. */
402
- deprecated?: string | undefined;
403
- /** Data type of the item. */
404
- datatype?: ("String" | "Bool" | "Int8" | "Int16" | "Int32" | "Int64" | "UInt8" | "UInt16" | "UInt32" | "UInt64" | "Double" | "Array" | "Array[3]" | "ISO 8601 timestamp") | undefined;
405
- /** Access mode for this item, some of them are not editable. */
406
- access?: ("R" | "W" | "RW") | undefined;
407
- /** Item visible on the API. */
408
- public?: boolean | undefined;
409
- /** TODO: What is this ? */
410
- implicit?: boolean | undefined;
411
- /** TODO: What is this ? */
412
- managed?: boolean | undefined;
413
- /** The device is considered awake when this item is set due a incoming command. */
414
- awake?: boolean | undefined;
415
- /** A static default value is fixed and can be not changed. */
416
- static?: (string | number | boolean) | undefined;
417
- /** Values range limit. */
418
- range?: [
419
- number,
420
- number
421
- ] | undefined;
422
- /** TODO: What is this ? */
423
- virtual?: boolean | undefined;
424
- /** Fonction used to read value. */
425
- read?: ({
426
- fn: "none";
427
- } | {
428
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
429
- ep?: (string | number) | undefined;
430
- /** Cluster ID. */
431
- cl: string;
432
- /** Attribute ID. */
433
- at?: (string | string[]) | undefined;
434
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
435
- mf?: string | undefined;
436
- /** Zigbee command. */
437
- cmd?: ("any" | string) | undefined;
438
- /** Zigbee command frame control. */
439
- fc?: (string | number) | undefined;
440
- /** Javascript expression to transform the attribute value to the Item value. */
441
- eval?: string | undefined;
442
- /** Relative path of a Javascript .js file. */
443
- script?: string | undefined;
444
- /** Generic function to read ZCL attributes. */
445
- fn?: undefined;
446
- } | {
447
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
448
- ep?: (string | number) | undefined;
449
- /** Cluster ID. */
450
- cl: string;
451
- /** Attribute ID. */
452
- at?: (string | string[]) | undefined;
453
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
454
- mf?: string | undefined;
455
- /** Zigbee command. */
456
- cmd?: ("any" | string) | undefined;
457
- /** Zigbee command frame control. */
458
- fc?: (string | number) | undefined;
459
- /** Javascript expression to transform the attribute value to the Item value. */
460
- eval?: string | undefined;
461
- /** Relative path of a Javascript .js file. */
462
- script?: string | undefined;
463
- /** Generic function to parse ZCL values from read/report commands. */
464
- fn: "zcl:attr";
465
- } | {
466
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
467
- ep?: (string | number) | undefined;
468
- /** Cluster ID. */
469
- cl: string;
470
- /** Attribute ID. */
471
- at?: (string | string[]) | undefined;
472
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
473
- mf?: string | undefined;
474
- /** Zigbee command. */
475
- cmd?: ("any" | string) | undefined;
476
- /** Zigbee command frame control. */
477
- fc?: (string | number) | undefined;
478
- /** Javascript expression to transform the attribute value to the Item value. */
479
- eval?: string | undefined;
480
- /** Relative path of a Javascript .js file. */
481
- script?: string | undefined;
482
- /** Generic function to parse ZCL values from read/report commands. */
483
- fn: "zcl:cmd";
484
- } | {
485
- /** Generic function to read all Tuya datapoints. It has no parameters. */
486
- fn: "tuya";
487
- }) | undefined;
488
- /** Fonction used to parse incoming values. */
489
- parse?: ({
490
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
491
- ep?: (string | number) | undefined;
492
- /** Cluster ID. */
493
- cl: string;
494
- /** Attribute ID. */
495
- at?: (string | string[]) | undefined;
496
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
497
- mf?: string | undefined;
498
- /** Zigbee command. */
499
- cmd?: ("any" | string) | undefined;
500
- /** Zigbee command frame control. */
501
- fc?: (string | number) | undefined;
502
- /** Javascript expression to transform the attribute value to the Item value. */
503
- eval?: string | undefined;
504
- /** Relative path of a Javascript .js file. */
505
- script?: string | undefined;
506
- /** Generic function to read ZCL attributes. */
507
- fn?: undefined;
508
- cppsrc?: string | undefined;
509
- } | {
510
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
511
- ep?: (string | number) | undefined;
512
- /** Cluster ID. */
513
- cl: string;
514
- /** Attribute ID. */
515
- at?: (string | string[]) | undefined;
516
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
517
- mf?: string | undefined;
518
- /** Zigbee command. */
519
- cmd?: ("any" | string) | undefined;
520
- /** Zigbee command frame control. */
521
- fc?: (string | number) | undefined;
522
- /** Javascript expression to transform the attribute value to the Item value. */
523
- eval?: string | undefined;
524
- /** Relative path of a Javascript .js file. */
525
- script?: string | undefined;
526
- /** Generic function to parse ZCL values from read/report commands. */
527
- fn: "zcl:attr";
528
- } | {
529
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
530
- ep?: (string | number) | undefined;
531
- /** Cluster ID. */
532
- cl: string;
533
- /** Attribute ID. */
534
- at?: (string | string[]) | undefined;
535
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
536
- mf?: string | undefined;
537
- /** Zigbee command. */
538
- cmd?: ("any" | string) | undefined;
539
- /** Zigbee command frame control. */
540
- fc?: (string | number) | undefined;
541
- /** Javascript expression to transform the attribute value to the Item value. */
542
- eval?: string | undefined;
543
- /** Relative path of a Javascript .js file. */
544
- script?: string | undefined;
545
- /** Generic function to parse ZCL values from read/report commands. */
546
- fn: "zcl:cmd";
547
- } | {
548
- /** Generic function to parse IAS ZONE status change notifications or zone status from read/report command. */
549
- fn: "ias:zonestatus";
550
- /** Sets the bitmask for Alert1 and Alert2 item of the IAS Zone status. */
551
- mask?: (("alarm1" | "alarm2") | "alarm1,alarm2") | undefined;
552
- } | {
553
- /** Generic function to to convert number to string. */
554
- fn: "numtostr";
555
- /** The source item holding the number. */
556
- srcitem: "state/y" | "state/x" | "state/windowopen" | "state/water" | "state/water_bis" | "state/voltage" | "state/vibrationstrength" | "state/vibration" | "state/valve" | "state/utc" | "state/tiltangle" | "state/tilt" | "state/test" | "state/temperature" | "state/temperature_bis" | "state/targetdistance" | "state/tampered" | "state/speed" | "state/seconds_remaining" | "state/sat" | "state/rotaryevent" | "state/replacefilter" | "state/reachable" | "state/production" | "state/pressure" | "state/pressure_bis" | "state/presenceevent" | "state/presence" | "state/power" | "state/pm2_5" | "state/panel" | "state/orientation_z" | "state/orientation_y" | "state/orientation_x" | "state/open" | "state/open_bis" | "state/on" | "state/music_sync" | "state/mountingmodeactive" | "state/moisture" | "state/measured_value" | "state/lux" | "state/lowbattery" | "state/lockstate" | "state/localtime" | "state/lightlevel" | "state/lift" | "state/lastupdated" | "state/lastset" | "state/lastcheckin" | "state/humidity" | "state/humidity_bis" | "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_P3" | "state/current_P2" | "state/current_P1" | "state/current" | "state/ct" | "state/consumption" | "state/consumption_2" | "state/colormode" | "state/charging" | "state/carbonmonoxide" | "state/buttonevent" | "state/bri" | "state/battery" | "state/angle" | "state/alert" | "state/alarm" | "state/airqualityppb" | "state/airqualityppb_bis" | "state/airquality" | "state/airquality_bis" | "state/action" | "config/windowopen_set" | "config/windowcoveringtype" | "config/volume" | "config/usertest" | "config/unoccupiedheatsetpoint" | "config/tuya_unlock" | "config/triggerdistance" | "config/triggerdistance_bis" | "config/tholdoffset" | "config/tholddark" | "config/temperature" | "config/swingmode" | "config/speed" | "config/sensitivitymax" | "config/sensitivity" | "config/sensitivity_bis" | "config/selftest" | "config/schedule_on" | "config/schedule" | "config/reversed" | "config/resetpresence" | "config/reportgrid" | "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/fadingtime" | "config/externalwindowopen" | "config/externalsensortemp" | "config/enrolled" | "config/duration" | "config/displayflipped" | "config/devicemode" | "config/devicemode_bis" | "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/gradient/pixel_count" | "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/battery_bis" | "config/allowtouchlink" | "config/alert" | "cap/transition_block" | "cap/sleeper" | "cap/on/off_with_effect" | "cap/measured_value/unit" | "cap/measured_value/substance" | "cap/measured_value/quantity" | "cap/measured_value/min" | "cap/measured_value/max" | "cap/groups/not_supported" | "cap/group" | "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/swversion_bis" | "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";
557
- /** Comparison operator (lt | le | eq | gt | ge) */
558
- op: "lt" | "le" | "eq" | "gt" | "ge";
559
- /** Array of (num, string) mappings */
560
- to: any;
561
- } | {
562
- /** Specialized function to parse time, local and last set time from read/report commands of the time cluster and auto-sync time if needed. */
563
- fn: "time";
564
- } | {
565
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
566
- ep?: (string | number) | undefined;
567
- /** Attribute ID. */
568
- at?: (string | string[]) | undefined;
569
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
570
- mf?: string | undefined;
571
- /** Javascript expression to transform the attribute value to the Item value. */
572
- eval?: string | undefined;
573
- /** Relative path of a Javascript .js file. */
574
- script?: string | undefined;
575
- /** Generic function to parse custom Xiaomi attributes and commands. */
576
- fn: "xiaomi:special";
577
- /** A 8-bit string hex value. */
578
- idx: string;
579
- } | {
580
- /** Javascript expression to transform the attribute value to the Item value. */
581
- eval?: string | undefined;
582
- /** Relative path of a Javascript .js file. */
583
- script?: string | undefined;
584
- /** Generic function to parse Tuya data. */
585
- fn: "tuya";
586
- /** Data point ID. 1-255 the datapoint ID. */
587
- dpid: number;
588
- }) | undefined;
589
- /** Fonction used to write value. */
590
- write?: ({
591
- fn: "none";
592
- } | {
593
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
594
- ep?: (string | number) | undefined;
595
- /** Cluster ID. */
596
- cl: string;
597
- /** Attribute ID. */
598
- at?: (string | string[]) | undefined;
599
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
600
- mf?: string | undefined;
601
- /** Zigbee command. */
602
- cmd?: ("any" | string) | undefined;
603
- /** Zigbee command frame control. */
604
- fc?: (string | number) | undefined;
605
- /** Javascript expression to transform the attribute value to the Item value. */
606
- eval?: string | undefined;
607
- /** Relative path of a Javascript .js file. */
608
- script?: string | undefined;
609
- "state.timeout"?: number | undefined;
610
- "change.timeout"?: number | undefined;
611
- /** Data type. */
612
- dt?: string | undefined;
613
- /** Generic function to read ZCL attributes. */
614
- fn?: undefined;
615
- cppsrc?: string | undefined;
616
- } | {
617
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
618
- ep?: (string | number) | undefined;
619
- /** Cluster ID. */
620
- cl: string;
621
- /** Attribute ID. */
622
- at?: (string | string[]) | undefined;
623
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
624
- mf?: string | undefined;
625
- /** Zigbee command. */
626
- cmd?: ("any" | string) | undefined;
627
- /** Zigbee command frame control. */
628
- fc?: (string | number) | undefined;
629
- /** Javascript expression to transform the attribute value to the Item value. */
630
- eval?: string | undefined;
631
- /** Relative path of a Javascript .js file. */
632
- script?: string | undefined;
633
- "state.timeout"?: number | undefined;
634
- "change.timeout"?: number | undefined;
635
- /** Data type. */
636
- dt?: string | undefined;
637
- /** Generic function to parse ZCL values from read/report commands. */
638
- fn: "zcl:attr";
639
- } | {
640
- /** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
641
- ep?: (string | number) | undefined;
642
- /** Cluster ID. */
643
- cl: string;
644
- /** Attribute ID. */
645
- at?: (string | string[]) | undefined;
646
- /** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
647
- mf?: string | undefined;
648
- /** Zigbee command. */
649
- cmd?: ("any" | string) | undefined;
650
- /** Zigbee command frame control. */
651
- fc?: (string | number) | undefined;
652
- /** Javascript expression to transform the attribute value to the Item value. */
653
- eval?: string | undefined;
654
- /** Relative path of a Javascript .js file. */
655
- script?: string | undefined;
656
- "state.timeout"?: number | undefined;
657
- "change.timeout"?: number | undefined;
658
- /** Data type. */
659
- dt?: string | undefined;
660
- /** Generic function to parse ZCL values from read/report commands. */
661
- fn: "zcl:cmd";
662
- } | {
663
- /** Javascript expression to transform the attribute value to the Item value. */
664
- eval?: string | undefined;
665
- /** Relative path of a Javascript .js file. */
666
- script?: string | undefined;
667
- /** Generic function to write Tuya data. */
668
- fn: "tuya";
669
- /** Data point ID. 1-255 the datapoint ID. */
670
- dpid: number;
671
- /** Data type. */
672
- dt: string;
673
- }) | undefined;
674
- /** Refresh interval used for read fonction, NEED to be superior at value used in binding part. */
675
- "refresh.interval"?: number | undefined;
676
- /** TODO: What is this ? */
677
- values?: unknown | undefined;
678
- /** Defaut value. */
679
- default?: unknown | undefined;
680
- } | {
681
- $schema?: string | undefined;
682
- schema: "subdevice1.schema.json";
683
- ddfvalidate?: boolean | undefined;
684
- type: ("$TYPE_AIR_PURIFIER" | "$TYPE_AIR_QUALITY_SENSOR" | "$TYPE_CARBONDIOXIDE_SENSOR" | "$TYPE_CARBONMONOXIDE_SENSOR" | "$TYPE_FORMALDEHYDE_SENSOR" | "$TYPE_PARTICULATEMATTER_SENSOR" | "$TYPE_ALARM_SENSOR" | "$TYPE_ANCILLARY_CONTROL" | "$TYPE_BATTERY_SENSOR" | "$TYPE_COLOR_LIGHT" | "$TYPE_COLOR_TEMPERATURE_LIGHT" | "$TYPE_CONSUMPTION_SENSOR" | "$TYPE_DIMMABLE_LIGHT" | "$TYPE_DIMMABLE_PLUGIN_UNIT" | "$TYPE_DIMMER_SWITCH" | "$TYPE_DOOR_LOCK" | "$TYPE_DOOR_LOCK_CONTROLLER" | "$TYPE_DOOR_LOCK_SENSOR" | "$TYPE_EXTENDED_COLOR_LIGHT" | "$TYPE_FIRE_SENSOR" | "$TYPE_HUMIDITY_SENSOR" | "$TYPE_LEVEL_CONTROL_SWITCH" | "$TYPE_LIGHT_LEVEL_SENSOR" | "$TYPE_MOISTURE_SENSOR" | "$TYPE_ON_OFF_LIGHT" | "$TYPE_ON_OFF_LIGHT_SWITCH" | "$TYPE_ON_OFF_OUTPUT" | "$TYPE_ON_OFF_PLUGIN_UNIT" | "$TYPE_ON_OFF_SWITCH" | "$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;
685
- name: string;
686
- restapi: "/lights" | "/sensors";
687
- order: number;
688
- uuid: [
689
- "$address.ext",
690
- string
691
- ] | [
692
- "$address.ext",
693
- string,
694
- string
695
- ];
696
- items: ("state/y" | "state/x" | "state/windowopen" | "state/water" | "state/water_bis" | "state/voltage" | "state/vibrationstrength" | "state/vibration" | "state/valve" | "state/utc" | "state/tiltangle" | "state/tilt" | "state/test" | "state/temperature" | "state/temperature_bis" | "state/targetdistance" | "state/tampered" | "state/speed" | "state/seconds_remaining" | "state/sat" | "state/rotaryevent" | "state/replacefilter" | "state/reachable" | "state/production" | "state/pressure" | "state/pressure_bis" | "state/presenceevent" | "state/presence" | "state/power" | "state/pm2_5" | "state/panel" | "state/orientation_z" | "state/orientation_y" | "state/orientation_x" | "state/open" | "state/open_bis" | "state/on" | "state/music_sync" | "state/mountingmodeactive" | "state/moisture" | "state/measured_value" | "state/lux" | "state/lowbattery" | "state/lockstate" | "state/localtime" | "state/lightlevel" | "state/lift" | "state/lastupdated" | "state/lastset" | "state/lastcheckin" | "state/humidity" | "state/humidity_bis" | "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_P3" | "state/current_P2" | "state/current_P1" | "state/current" | "state/ct" | "state/consumption" | "state/consumption_2" | "state/colormode" | "state/charging" | "state/carbonmonoxide" | "state/buttonevent" | "state/bri" | "state/battery" | "state/angle" | "state/alert" | "state/alarm" | "state/airqualityppb" | "state/airqualityppb_bis" | "state/airquality" | "state/airquality_bis" | "state/action" | "config/windowopen_set" | "config/windowcoveringtype" | "config/volume" | "config/usertest" | "config/unoccupiedheatsetpoint" | "config/tuya_unlock" | "config/triggerdistance" | "config/triggerdistance_bis" | "config/tholdoffset" | "config/tholddark" | "config/temperature" | "config/swingmode" | "config/speed" | "config/sensitivitymax" | "config/sensitivity" | "config/sensitivity_bis" | "config/selftest" | "config/schedule_on" | "config/schedule" | "config/reversed" | "config/resetpresence" | "config/reportgrid" | "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/fadingtime" | "config/externalwindowopen" | "config/externalsensortemp" | "config/enrolled" | "config/duration" | "config/displayflipped" | "config/devicemode" | "config/devicemode_bis" | "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/gradient/pixel_count" | "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/battery_bis" | "config/allowtouchlink" | "config/alert" | "cap/transition_block" | "cap/sleeper" | "cap/on/off_with_effect" | "cap/measured_value/unit" | "cap/measured_value/substance" | "cap/measured_value/quantity" | "cap/measured_value/min" | "cap/measured_value/max" | "cap/groups/not_supported" | "cap/group" | "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/swversion_bis" | "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")[];
697
- items_optional?: ("state/y" | "state/x" | "state/windowopen" | "state/water" | "state/water_bis" | "state/voltage" | "state/vibrationstrength" | "state/vibration" | "state/valve" | "state/utc" | "state/tiltangle" | "state/tilt" | "state/test" | "state/temperature" | "state/temperature_bis" | "state/targetdistance" | "state/tampered" | "state/speed" | "state/seconds_remaining" | "state/sat" | "state/rotaryevent" | "state/replacefilter" | "state/reachable" | "state/production" | "state/pressure" | "state/pressure_bis" | "state/presenceevent" | "state/presence" | "state/power" | "state/pm2_5" | "state/panel" | "state/orientation_z" | "state/orientation_y" | "state/orientation_x" | "state/open" | "state/open_bis" | "state/on" | "state/music_sync" | "state/mountingmodeactive" | "state/moisture" | "state/measured_value" | "state/lux" | "state/lowbattery" | "state/lockstate" | "state/localtime" | "state/lightlevel" | "state/lift" | "state/lastupdated" | "state/lastset" | "state/lastcheckin" | "state/humidity" | "state/humidity_bis" | "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_P3" | "state/current_P2" | "state/current_P1" | "state/current" | "state/ct" | "state/consumption" | "state/consumption_2" | "state/colormode" | "state/charging" | "state/carbonmonoxide" | "state/buttonevent" | "state/bri" | "state/battery" | "state/angle" | "state/alert" | "state/alarm" | "state/airqualityppb" | "state/airqualityppb_bis" | "state/airquality" | "state/airquality_bis" | "state/action" | "config/windowopen_set" | "config/windowcoveringtype" | "config/volume" | "config/usertest" | "config/unoccupiedheatsetpoint" | "config/tuya_unlock" | "config/triggerdistance" | "config/triggerdistance_bis" | "config/tholdoffset" | "config/tholddark" | "config/temperature" | "config/swingmode" | "config/speed" | "config/sensitivitymax" | "config/sensitivity" | "config/sensitivity_bis" | "config/selftest" | "config/schedule_on" | "config/schedule" | "config/reversed" | "config/resetpresence" | "config/reportgrid" | "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/fadingtime" | "config/externalwindowopen" | "config/externalsensortemp" | "config/enrolled" | "config/duration" | "config/displayflipped" | "config/devicemode" | "config/devicemode_bis" | "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/gradient/pixel_count" | "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/battery_bis" | "config/allowtouchlink" | "config/alert" | "cap/transition_block" | "cap/sleeper" | "cap/on/off_with_effect" | "cap/measured_value/unit" | "cap/measured_value/substance" | "cap/measured_value/quantity" | "cap/measured_value/min" | "cap/measured_value/max" | "cap/groups/not_supported" | "cap/group" | "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/swversion_bis" | "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")[] | undefined;
698
- };
3
+ export type DDF = any;
699
4
 
700
5
  export interface GenericsData {
701
6
  attributes: string[]
@@ -1,5 +1,5 @@
1
1
  import { z as e } from "zod";
2
- const M = "2.32.0", O = {
2
+ const M = "2.33.2", O = {
3
3
  "devcap1.schema.json": [
4
4
  z,
5
5
  P,
@@ -259,7 +259,7 @@ function C(t) {
259
259
  function U() {
260
260
  return e.string().regex(
261
261
  // Regex for AAAA-MM-JJ
262
- /^(\d{4})-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:0[1-9])|(?:[12][0-9])|(?:3[01]))$/,
262
+ /^(\d{4})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])$/,
263
263
  "Invalid date value"
264
264
  );
265
265
  }
@@ -576,6 +576,7 @@ function ee(t) {
576
576
  e.string().regex(/^(?!\$TYPE_).*/g, "The type start with $TYPE_ but is not present in constants.json")
577
577
  ]),
578
578
  name: e.string(),
579
+ ui_name: e.string().max(64),
579
580
  restapi: e.enum(["/lights", "/sensors"]),
580
581
  order: e.number(),
581
582
  uuid: S(),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deconz-community/ddf-validator",
3
3
  "type": "module",
4
- "version": "2.32.0",
4
+ "version": "2.33.2",
5
5
  "description": "Validating DDF files for deconz",
6
6
  "author": {
7
7
  "name": "Zehir",
@@ -56,29 +56,29 @@
56
56
  "node": ">=16.0.0"
57
57
  },
58
58
  "dependencies": {
59
- "zod": "^3.23.8"
59
+ "zod": "^4.1.12"
60
60
  },
61
61
  "devDependencies": {
62
- "@types/jsdom": "^21.1.7",
63
- "@types/node": "^20.16.5",
64
- "@typescript-eslint/eslint-plugin": "^8.9.0",
65
- "@typescript-eslint/parser": "^8.9.0",
62
+ "@types/jsdom": "^27.0.0",
63
+ "@types/node": "^20.19.23",
64
+ "@typescript-eslint/eslint-plugin": "^8.46.2",
65
+ "@typescript-eslint/parser": "^8.46.2",
66
66
  "degit": "^2.8.4",
67
- "eslint": "^9.12.0",
68
- "fast-glob": "^3.3.2",
69
- "lint-staged": "^15.2.10",
67
+ "eslint": "^9.38.0",
68
+ "fast-glob": "^3.3.3",
69
+ "lint-staged": "^16.2.5",
70
70
  "rimraf": "^5.0.10",
71
- "stylelint": "^16.10.0",
72
- "stylelint-config-recommended": "^14.0.1",
71
+ "stylelint": "^16.25.0",
72
+ "stylelint-config-recommended": "^17.0.0",
73
73
  "stylelint-config-sass-guidelines": "^12.1.0",
74
- "taze": "^0.17.2",
74
+ "taze": "^19.8.1",
75
75
  "ts-node": "^10.9.2",
76
- "typescript": "^5.6.3",
77
- "vite": "^5.4.9",
78
- "vitest": "^2.1.3",
79
- "zod-to-json-schema": "^3.23.3",
76
+ "typescript": "^5.9.3",
77
+ "vite": "^6.4.1",
78
+ "vitest": "^3.2.4",
79
+ "zod-to-json-schema": "^3.24.6",
80
80
  "zod-to-ts": "^1.2.0",
81
- "zod-validation-error": "^3.4.0"
81
+ "zod-validation-error": "^4.0.2"
82
82
  },
83
83
  "scripts": {
84
84
  "build": "pnpm run build:vite && pnpm run build:dts",
@@ -88,6 +88,6 @@
88
88
  "lint": "eslint",
89
89
  "test": "vitest run",
90
90
  "test:watch": "vitest",
91
- "test:download-sample": "rimraf ./test-data && degit dresden-elektronik/deconz-rest-plugin /tmp/test-data && mv /tmp/test-data/devices ./test-data && rimraf /tmp/test-data"
91
+ "test:download-sample": "rimraf ./test-data && degit manup/deconz-rest-plugin /tmp/test-data && mv /tmp/test-data/devices ./test-data && rimraf /tmp/test-data"
92
92
  }
93
93
  }