@deconz-community/ddf-validator 2.25.0 → 2.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ddf-schema.json +1 -1
- package/dist/ddf-validator.cjs +1 -1
- package/dist/ddf-validator.d.ts +36 -12
- package/dist/ddf-validator.mjs +3 -4
- package/package.json +15 -15
package/dist/ddf-schema.json
CHANGED
|
@@ -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: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."},"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."},"product":{"type":"string","description":"Complements the model id to be shown in the UI."},"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."},"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."},"fc":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number"}],"description":"Zigbee command frame control."},"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"},"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"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"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"},"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"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"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"},"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"},"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"},"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"},"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"},"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"},"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"},"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"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"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"},"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"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"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"},"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"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"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"},"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"},"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"},"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"},"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"},"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"},"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":{"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: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."},"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."},"product":{"type":"string","description":"Complements the model id to be shown in the UI."},"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#"}
|
package/dist/ddf-validator.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),G="2.25.0",w={"devcap1.schema.json":[M,P,W,L,N,Y],"constants2.schema.json":[R]};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 R(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 N(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 V(){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."),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({fc:e.z.optional(l(2).or(e.z.number())).describe("Zigbee command frame control.")}),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 k(){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:V().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(k()).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: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."),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."),product:e.z.optional(e.z.string()).describe("Complements the model id to be shown in the UI."),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.27.0",w={"devcap1.schema.json":[M,P,W,L,N,Y],"constants2.schema.json":[R]};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 R(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 N(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 V(){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 k(){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:V().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(k()).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: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."),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."),product:e.z.optional(e.z.string()).describe("Complements the model id to be shown in the UI."),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;
|
package/dist/ddf-validator.d.ts
CHANGED
|
@@ -97,12 +97,12 @@ export type DDF = {
|
|
|
97
97
|
mf?: string | undefined;
|
|
98
98
|
/** Zigbee command. */
|
|
99
99
|
cmd?: ("any" | string) | undefined;
|
|
100
|
+
/** Zigbee command frame control. */
|
|
101
|
+
fc?: (string | number) | undefined;
|
|
100
102
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
101
103
|
eval?: string | undefined;
|
|
102
104
|
/** Relative path of a Javascript .js file. */
|
|
103
105
|
script?: string | undefined;
|
|
104
|
-
/** Zigbee command frame control. */
|
|
105
|
-
fc?: (string | number) | undefined;
|
|
106
106
|
/** Generic function to read ZCL attributes. */
|
|
107
107
|
fn?: undefined;
|
|
108
108
|
} | {
|
|
@@ -116,12 +116,12 @@ export type DDF = {
|
|
|
116
116
|
mf?: string | undefined;
|
|
117
117
|
/** Zigbee command. */
|
|
118
118
|
cmd?: ("any" | string) | undefined;
|
|
119
|
+
/** Zigbee command frame control. */
|
|
120
|
+
fc?: (string | number) | undefined;
|
|
119
121
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
120
122
|
eval?: string | undefined;
|
|
121
123
|
/** Relative path of a Javascript .js file. */
|
|
122
124
|
script?: string | undefined;
|
|
123
|
-
/** Zigbee command frame control. */
|
|
124
|
-
fc?: (string | number) | undefined;
|
|
125
125
|
/** Generic function to parse ZCL values from read/report commands. */
|
|
126
126
|
fn: "zcl:attr";
|
|
127
127
|
} | {
|
|
@@ -135,12 +135,12 @@ export type DDF = {
|
|
|
135
135
|
mf?: string | undefined;
|
|
136
136
|
/** Zigbee command. */
|
|
137
137
|
cmd?: ("any" | string) | undefined;
|
|
138
|
+
/** Zigbee command frame control. */
|
|
139
|
+
fc?: (string | number) | undefined;
|
|
138
140
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
139
141
|
eval?: string | undefined;
|
|
140
142
|
/** Relative path of a Javascript .js file. */
|
|
141
143
|
script?: string | undefined;
|
|
142
|
-
/** Zigbee command frame control. */
|
|
143
|
-
fc?: (string | number) | undefined;
|
|
144
144
|
/** Generic function to parse ZCL values from read/report commands. */
|
|
145
145
|
fn: "zcl:cmd";
|
|
146
146
|
} | {
|
|
@@ -159,6 +159,8 @@ export type DDF = {
|
|
|
159
159
|
mf?: string | undefined;
|
|
160
160
|
/** Zigbee command. */
|
|
161
161
|
cmd?: ("any" | string) | undefined;
|
|
162
|
+
/** Zigbee command frame control. */
|
|
163
|
+
fc?: (string | number) | undefined;
|
|
162
164
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
163
165
|
eval?: string | undefined;
|
|
164
166
|
/** Relative path of a Javascript .js file. */
|
|
@@ -177,6 +179,8 @@ export type DDF = {
|
|
|
177
179
|
mf?: string | undefined;
|
|
178
180
|
/** Zigbee command. */
|
|
179
181
|
cmd?: ("any" | string) | undefined;
|
|
182
|
+
/** Zigbee command frame control. */
|
|
183
|
+
fc?: (string | number) | undefined;
|
|
180
184
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
181
185
|
eval?: string | undefined;
|
|
182
186
|
/** Relative path of a Javascript .js file. */
|
|
@@ -194,6 +198,8 @@ export type DDF = {
|
|
|
194
198
|
mf?: string | undefined;
|
|
195
199
|
/** Zigbee command. */
|
|
196
200
|
cmd?: ("any" | string) | undefined;
|
|
201
|
+
/** Zigbee command frame control. */
|
|
202
|
+
fc?: (string | number) | undefined;
|
|
197
203
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
198
204
|
eval?: string | undefined;
|
|
199
205
|
/** Relative path of a Javascript .js file. */
|
|
@@ -256,6 +262,8 @@ export type DDF = {
|
|
|
256
262
|
mf?: string | undefined;
|
|
257
263
|
/** Zigbee command. */
|
|
258
264
|
cmd?: ("any" | string) | undefined;
|
|
265
|
+
/** Zigbee command frame control. */
|
|
266
|
+
fc?: (string | number) | undefined;
|
|
259
267
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
260
268
|
eval?: string | undefined;
|
|
261
269
|
/** Relative path of a Javascript .js file. */
|
|
@@ -278,6 +286,8 @@ export type DDF = {
|
|
|
278
286
|
mf?: string | undefined;
|
|
279
287
|
/** Zigbee command. */
|
|
280
288
|
cmd?: ("any" | string) | undefined;
|
|
289
|
+
/** Zigbee command frame control. */
|
|
290
|
+
fc?: (string | number) | undefined;
|
|
281
291
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
282
292
|
eval?: string | undefined;
|
|
283
293
|
/** Relative path of a Javascript .js file. */
|
|
@@ -299,6 +309,8 @@ export type DDF = {
|
|
|
299
309
|
mf?: string | undefined;
|
|
300
310
|
/** Zigbee command. */
|
|
301
311
|
cmd?: ("any" | string) | undefined;
|
|
312
|
+
/** Zigbee command frame control. */
|
|
313
|
+
fc?: (string | number) | undefined;
|
|
302
314
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
303
315
|
eval?: string | undefined;
|
|
304
316
|
/** Relative path of a Javascript .js file. */
|
|
@@ -417,12 +429,12 @@ export type DDF = {
|
|
|
417
429
|
mf?: string | undefined;
|
|
418
430
|
/** Zigbee command. */
|
|
419
431
|
cmd?: ("any" | string) | undefined;
|
|
432
|
+
/** Zigbee command frame control. */
|
|
433
|
+
fc?: (string | number) | undefined;
|
|
420
434
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
421
435
|
eval?: string | undefined;
|
|
422
436
|
/** Relative path of a Javascript .js file. */
|
|
423
437
|
script?: string | undefined;
|
|
424
|
-
/** Zigbee command frame control. */
|
|
425
|
-
fc?: (string | number) | undefined;
|
|
426
438
|
/** Generic function to read ZCL attributes. */
|
|
427
439
|
fn?: undefined;
|
|
428
440
|
} | {
|
|
@@ -436,12 +448,12 @@ export type DDF = {
|
|
|
436
448
|
mf?: string | undefined;
|
|
437
449
|
/** Zigbee command. */
|
|
438
450
|
cmd?: ("any" | string) | undefined;
|
|
451
|
+
/** Zigbee command frame control. */
|
|
452
|
+
fc?: (string | number) | undefined;
|
|
439
453
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
440
454
|
eval?: string | undefined;
|
|
441
455
|
/** Relative path of a Javascript .js file. */
|
|
442
456
|
script?: string | undefined;
|
|
443
|
-
/** Zigbee command frame control. */
|
|
444
|
-
fc?: (string | number) | undefined;
|
|
445
457
|
/** Generic function to parse ZCL values from read/report commands. */
|
|
446
458
|
fn: "zcl:attr";
|
|
447
459
|
} | {
|
|
@@ -455,12 +467,12 @@ export type DDF = {
|
|
|
455
467
|
mf?: string | undefined;
|
|
456
468
|
/** Zigbee command. */
|
|
457
469
|
cmd?: ("any" | string) | undefined;
|
|
470
|
+
/** Zigbee command frame control. */
|
|
471
|
+
fc?: (string | number) | undefined;
|
|
458
472
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
459
473
|
eval?: string | undefined;
|
|
460
474
|
/** Relative path of a Javascript .js file. */
|
|
461
475
|
script?: string | undefined;
|
|
462
|
-
/** Zigbee command frame control. */
|
|
463
|
-
fc?: (string | number) | undefined;
|
|
464
476
|
/** Generic function to parse ZCL values from read/report commands. */
|
|
465
477
|
fn: "zcl:cmd";
|
|
466
478
|
} | {
|
|
@@ -479,6 +491,8 @@ export type DDF = {
|
|
|
479
491
|
mf?: string | undefined;
|
|
480
492
|
/** Zigbee command. */
|
|
481
493
|
cmd?: ("any" | string) | undefined;
|
|
494
|
+
/** Zigbee command frame control. */
|
|
495
|
+
fc?: (string | number) | undefined;
|
|
482
496
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
483
497
|
eval?: string | undefined;
|
|
484
498
|
/** Relative path of a Javascript .js file. */
|
|
@@ -497,6 +511,8 @@ export type DDF = {
|
|
|
497
511
|
mf?: string | undefined;
|
|
498
512
|
/** Zigbee command. */
|
|
499
513
|
cmd?: ("any" | string) | undefined;
|
|
514
|
+
/** Zigbee command frame control. */
|
|
515
|
+
fc?: (string | number) | undefined;
|
|
500
516
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
501
517
|
eval?: string | undefined;
|
|
502
518
|
/** Relative path of a Javascript .js file. */
|
|
@@ -514,6 +530,8 @@ export type DDF = {
|
|
|
514
530
|
mf?: string | undefined;
|
|
515
531
|
/** Zigbee command. */
|
|
516
532
|
cmd?: ("any" | string) | undefined;
|
|
533
|
+
/** Zigbee command frame control. */
|
|
534
|
+
fc?: (string | number) | undefined;
|
|
517
535
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
518
536
|
eval?: string | undefined;
|
|
519
537
|
/** Relative path of a Javascript .js file. */
|
|
@@ -576,6 +594,8 @@ export type DDF = {
|
|
|
576
594
|
mf?: string | undefined;
|
|
577
595
|
/** Zigbee command. */
|
|
578
596
|
cmd?: ("any" | string) | undefined;
|
|
597
|
+
/** Zigbee command frame control. */
|
|
598
|
+
fc?: (string | number) | undefined;
|
|
579
599
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
580
600
|
eval?: string | undefined;
|
|
581
601
|
/** Relative path of a Javascript .js file. */
|
|
@@ -598,6 +618,8 @@ export type DDF = {
|
|
|
598
618
|
mf?: string | undefined;
|
|
599
619
|
/** Zigbee command. */
|
|
600
620
|
cmd?: ("any" | string) | undefined;
|
|
621
|
+
/** Zigbee command frame control. */
|
|
622
|
+
fc?: (string | number) | undefined;
|
|
601
623
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
602
624
|
eval?: string | undefined;
|
|
603
625
|
/** Relative path of a Javascript .js file. */
|
|
@@ -619,6 +641,8 @@ export type DDF = {
|
|
|
619
641
|
mf?: string | undefined;
|
|
620
642
|
/** Zigbee command. */
|
|
621
643
|
cmd?: ("any" | string) | undefined;
|
|
644
|
+
/** Zigbee command frame control. */
|
|
645
|
+
fc?: (string | number) | undefined;
|
|
622
646
|
/** Javascript expression to transform the attribute value to the Item value. */
|
|
623
647
|
eval?: string | undefined;
|
|
624
648
|
/** Relative path of a Javascript .js file. */
|
package/dist/ddf-validator.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as e } from "zod";
|
|
2
|
-
const M = "2.
|
|
2
|
+
const M = "2.27.0", O = {
|
|
3
3
|
"devcap1.schema.json": [
|
|
4
4
|
z,
|
|
5
5
|
P,
|
|
@@ -310,12 +310,11 @@ const x = e.strictObject({
|
|
|
310
310
|
at: e.optional(l(4).or(e.array(l(4)))).describe("Attribute ID."),
|
|
311
311
|
mf: e.optional(l(4)).describe("Manufacturer code, must be set to 0x0000 for non manufacturer specific commands."),
|
|
312
312
|
cmd: e.optional(e.union([e.literal("any"), l(2)])).describe("Zigbee command."),
|
|
313
|
+
fc: e.optional(l(2).or(e.number())).describe("Zigbee command frame control."),
|
|
313
314
|
eval: e.optional(F()).describe("Javascript expression to transform the attribute value to the Item value."),
|
|
314
315
|
script: e.optional(A()).describe("Relative path of a Javascript .js file.")
|
|
315
316
|
}), f = {
|
|
316
|
-
read: x.extend({
|
|
317
|
-
fc: e.optional(l(2).or(e.number())).describe("Zigbee command frame control.")
|
|
318
|
-
}),
|
|
317
|
+
read: x.extend({}),
|
|
319
318
|
parse: x.extend({}),
|
|
320
319
|
write: x.extend({
|
|
321
320
|
"state.timeout": e.optional(e.number()),
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deconz-community/ddf-validator",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
5
|
-
"packageManager": "pnpm@8.
|
|
4
|
+
"version": "2.27.0",
|
|
5
|
+
"packageManager": "pnpm@8.15.7",
|
|
6
6
|
"description": "Validating DDF files for deconz",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Zehir",
|
|
@@ -60,26 +60,26 @@
|
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/jsdom": "^21.1.6",
|
|
63
|
-
"@types/node": "^20.
|
|
63
|
+
"@types/node": "^20.12.7",
|
|
64
64
|
"@types/pako": "^2.0.3",
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
66
|
-
"@typescript-eslint/parser": "^
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "^7.7.0",
|
|
66
|
+
"@typescript-eslint/parser": "^7.7.0",
|
|
67
67
|
"degit": "^2.8.4",
|
|
68
|
-
"eslint": "^
|
|
68
|
+
"eslint": "^9.0.0",
|
|
69
69
|
"fast-glob": "^3.3.2",
|
|
70
|
-
"lint-staged": "^15.2.
|
|
70
|
+
"lint-staged": "^15.2.2",
|
|
71
71
|
"rimraf": "^5.0.5",
|
|
72
|
-
"stylelint": "^16.
|
|
72
|
+
"stylelint": "^16.3.1",
|
|
73
73
|
"stylelint-config-recommended": "^14.0.0",
|
|
74
|
-
"stylelint-config-sass-guidelines": "^
|
|
75
|
-
"taze": "^0.13.
|
|
74
|
+
"stylelint-config-sass-guidelines": "^11.1.0",
|
|
75
|
+
"taze": "^0.13.4",
|
|
76
76
|
"ts-node": "^10.9.2",
|
|
77
|
-
"typescript": "^5.
|
|
78
|
-
"vite": "^5.
|
|
79
|
-
"vitest": "^1.0
|
|
80
|
-
"zod-to-json-schema": "^3.22.
|
|
77
|
+
"typescript": "^5.4.5",
|
|
78
|
+
"vite": "^5.2.8",
|
|
79
|
+
"vitest": "^1.5.0",
|
|
80
|
+
"zod-to-json-schema": "^3.22.5",
|
|
81
81
|
"zod-to-ts": "^1.2.0",
|
|
82
|
-
"zod-validation-error": "^
|
|
82
|
+
"zod-validation-error": "^3.1.0"
|
|
83
83
|
},
|
|
84
84
|
"scripts": {
|
|
85
85
|
"build": "pnpm run build:vite && pnpm run build:dts",
|