@deconz-community/ddf-validator 2.29.0 → 2.30.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.
@@ -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."},"fc":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number"}],"description":"Zigbee command frame control."},"eval":{"type":"string","description":"Javascript expression to transform the attribute value to the Item value."},"script":{"type":"string","description":"Relative path of a Javascript .js file."},"fn":{"not":{},"description":"Generic function to read ZCL attributes."}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"tuya","description":"Generic function to read all Tuya datapoints. It has no parameters."}},"required":["fn"],"additionalProperties":false}],"description":"Fonction used to read value."},"parse":{"anyOf":[{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"not":{},"description":"Generic function to read ZCL attributes."},"cppsrc":{"type":"string"}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"ias:zonestatus","description":"Generic function to parse IAS ZONE status change notifications or zone status from read/report command."},"mask":{"anyOf":[{"type":"string","enum":["alarm1","alarm2"]},{"type":"string","const":"alarm1,alarm2"}],"description":"Sets the bitmask for Alert1 and Alert2 item of the IAS Zone status."}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"numtostr","description":"Generic function to to convert number to string."},"srcitem":{"type":"string","enum":["state/y","state/x","state/windowopen","state/water","state/water_bis","state/voltage","state/vibrationstrength","state/vibration","state/valve","state/utc","state/tiltangle","state/tilt","state/test","state/temperature","state/temperature_bis","state/targetdistance","state/tampered","state/speed","state/seconds_remaining","state/sat","state/rotaryevent","state/replacefilter","state/reachable","state/production","state/pressure","state/pressure_bis","state/presenceevent","state/presence","state/power","state/pm2_5","state/panel","state/orientation_z","state/orientation_y","state/orientation_x","state/open","state/open_bis","state/on","state/music_sync","state/mountingmodeactive","state/moisture","state/measured_value","state/lux","state/lowbattery","state/lockstate","state/localtime","state/lightlevel","state/lift","state/lastupdated","state/lastset","state/lastcheckin","state/humidity","state/humidity_bis","state/hue","state/heating","state/gradient","state/gesture","state/fire","state/filterruntime","state/expectedrotation","state/expectedeventduration","state/eventduration","state/errorcode","state/effect","state/deviceruntime","state/daylight","state/dark","state/current_P3","state/current_P2","state/current_P1","state/current","state/ct","state/consumption","state/consumption_2","state/colormode","state/charging","state/carbonmonoxide","state/buttonevent","state/bri","state/battery","state/angle","state/alert","state/alarm","state/airqualityppb","state/airqualityppb_bis","state/airquality","state/airquality_bis","state/action","config/windowopen_set","config/windowcoveringtype","config/volume","config/usertest","config/unoccupiedheatsetpoint","config/tuya_unlock","config/triggerdistance","config/triggerdistance_bis","config/tholdoffset","config/tholddark","config/temperature","config/swingmode","config/speed","config/sensitivitymax","config/sensitivity","config/sensitivity_bis","config/selftest","config/schedule_on","config/schedule","config/reversed","config/resetpresence","config/reportgrid","config/reachable","config/pulseconfiguration","config/preset","config/pending","config/on/startup","config/on","config/offset","config/mountingmode","config/mode","config/melody","config/locked","config/lock","config/ledindication","config/interfacemode","config/heatsetpoint","config/group","config/filterlifetime","config/fanmode","config/fadingtime","config/externalwindowopen","config/externalsensortemp","config/enrolled","config/duration","config/displayflipped","config/devicemode","config/devicemode_bis","config/delay","config/ctmin","config/ctmax","config/coolsetpoint","config/controlsequence","config/configured","config/colorcapabilities","config/color/xy/startup_y","config/color/xy/startup_x","config/color/gradient/reversed","config/color/gradient/pixel_count","config/color/execute_if_off","config/color/ct/startup","config/clickmode","config/checkin","config/bri/startup","config/bri/onoff_transitiontime","config/bri/on_level","config/bri/min","config/bri/max","config/bri/execute_if_off","config/battery","config/battery_bis","config/allowtouchlink","config/alert","cap/transition_block","cap/sleeper","cap/on/off_with_effect","cap/measured_value/unit","cap/measured_value/substance","cap/measured_value/quantity","cap/measured_value/min","cap/measured_value/max","cap/groups/not_supported","cap/group","cap/color/xy/red_y","cap/color/xy/red_x","cap/color/xy/green_y","cap/color/xy/green_x","cap/color/xy/blue_y","cap/color/xy/blue_x","cap/color/gradient/styles","cap/color/gradient/pixel_length","cap/color/gradient/pixel_count","cap/color/gradient/max_segments","cap/color/gamut_type","cap/color/effects","cap/color/ct/min","cap/color/ct/max","cap/color/ct/computes_xy","cap/color/capabilities","cap/bri/move_with_onoff","cap/bri/min_dim_level","cap/alert/trigger_effect","attr/uniqueid","attr/type","attr/swversion","attr/swversion_bis","attr/swconfigid","attr/productname","attr/productid","attr/powerup","attr/poweronlevel","attr/poweronct","attr/name","attr/modelid","attr/mode","attr/manufacturername","attr/lastseen","attr/lastannounced","attr/id"],"description":"The source item holding the number."},"op":{"type":"string","enum":["lt","le","eq","gt","ge"],"description":"Comparison operator (lt | le | eq | gt | ge)"},"to":{"description":"Array of (num, string) mappings"}},"required":["fn","srcitem","op","to"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"time","description":"Specialized function to parse time, local and last set time from read/report commands of the time cluster and auto-sync time if needed."}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"xiaomi:special","description":"Generic function to parse custom Xiaomi attributes and commands."},"idx":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"A 8-bit string hex value."}},"required":["fn","idx"],"additionalProperties":false},{"type":"object","properties":{"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"tuya","description":"Generic function to parse Tuya data."},"dpid":{"type":"number","description":"Data point ID. 1-255 the datapoint ID."}},"required":["fn","dpid"],"additionalProperties":false}],"description":"Fonction used to parse incoming values."},"write":{"anyOf":[{"type":"object","properties":{"fn":{"type":"string","const":"none"}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"type":"number"},"change.timeout":{"type":"number"},"dt":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"Data type."},"fn":{"not":{},"description":"Generic function to read ZCL attributes."},"cppsrc":{"type":"string"}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"tuya","description":"Generic function to write Tuya data."},"dpid":{"type":"number","description":"Data point ID. 1-255 the datapoint ID."},"dt":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"Data type."}},"required":["fn","dpid","dt"],"additionalProperties":false}],"description":"Fonction used to write value."},"refresh.interval":{"type":"number","description":"Refresh interval used for read fonction, NEED to be superior at value used in binding part."},"values":{"description":"TODO: What is this ?"},"default":{"description":"Defaut value."},"name":{"type":"string","enum":["state/y","state/x","state/windowopen","state/water","state/water_bis","state/voltage","state/vibrationstrength","state/vibration","state/valve","state/utc","state/tiltangle","state/tilt","state/test","state/temperature","state/temperature_bis","state/targetdistance","state/tampered","state/speed","state/seconds_remaining","state/sat","state/rotaryevent","state/replacefilter","state/reachable","state/production","state/pressure","state/pressure_bis","state/presenceevent","state/presence","state/power","state/pm2_5","state/panel","state/orientation_z","state/orientation_y","state/orientation_x","state/open","state/open_bis","state/on","state/music_sync","state/mountingmodeactive","state/moisture","state/measured_value","state/lux","state/lowbattery","state/lockstate","state/localtime","state/lightlevel","state/lift","state/lastupdated","state/lastset","state/lastcheckin","state/humidity","state/humidity_bis","state/hue","state/heating","state/gradient","state/gesture","state/fire","state/filterruntime","state/expectedrotation","state/expectedeventduration","state/eventduration","state/errorcode","state/effect","state/deviceruntime","state/daylight","state/dark","state/current_P3","state/current_P2","state/current_P1","state/current","state/ct","state/consumption","state/consumption_2","state/colormode","state/charging","state/carbonmonoxide","state/buttonevent","state/bri","state/battery","state/angle","state/alert","state/alarm","state/airqualityppb","state/airqualityppb_bis","state/airquality","state/airquality_bis","state/action","config/windowopen_set","config/windowcoveringtype","config/volume","config/usertest","config/unoccupiedheatsetpoint","config/tuya_unlock","config/triggerdistance","config/triggerdistance_bis","config/tholdoffset","config/tholddark","config/temperature","config/swingmode","config/speed","config/sensitivitymax","config/sensitivity","config/sensitivity_bis","config/selftest","config/schedule_on","config/schedule","config/reversed","config/resetpresence","config/reportgrid","config/reachable","config/pulseconfiguration","config/preset","config/pending","config/on/startup","config/on","config/offset","config/mountingmode","config/mode","config/melody","config/locked","config/lock","config/ledindication","config/interfacemode","config/heatsetpoint","config/group","config/filterlifetime","config/fanmode","config/fadingtime","config/externalwindowopen","config/externalsensortemp","config/enrolled","config/duration","config/displayflipped","config/devicemode","config/devicemode_bis","config/delay","config/ctmin","config/ctmax","config/coolsetpoint","config/controlsequence","config/configured","config/colorcapabilities","config/color/xy/startup_y","config/color/xy/startup_x","config/color/gradient/reversed","config/color/gradient/pixel_count","config/color/execute_if_off","config/color/ct/startup","config/clickmode","config/checkin","config/bri/startup","config/bri/onoff_transitiontime","config/bri/on_level","config/bri/min","config/bri/max","config/bri/execute_if_off","config/battery","config/battery_bis","config/allowtouchlink","config/alert","cap/transition_block","cap/sleeper","cap/on/off_with_effect","cap/measured_value/unit","cap/measured_value/substance","cap/measured_value/quantity","cap/measured_value/min","cap/measured_value/max","cap/groups/not_supported","cap/group","cap/color/xy/red_y","cap/color/xy/red_x","cap/color/xy/green_y","cap/color/xy/green_x","cap/color/xy/blue_y","cap/color/xy/blue_x","cap/color/gradient/styles","cap/color/gradient/pixel_length","cap/color/gradient/pixel_count","cap/color/gradient/max_segments","cap/color/gamut_type","cap/color/effects","cap/color/ct/min","cap/color/ct/max","cap/color/ct/computes_xy","cap/color/capabilities","cap/bri/move_with_onoff","cap/bri/min_dim_level","cap/alert/trigger_effect","attr/uniqueid","attr/type","attr/swversion","attr/swversion_bis","attr/swconfigid","attr/productname","attr/productid","attr/powerup","attr/poweronlevel","attr/poweronct","attr/name","attr/modelid","attr/mode","attr/manufacturername","attr/lastseen","attr/lastannounced","attr/id"],"description":"Item name."}},"required":["name"],"additionalProperties":false}},"example":{}},"required":["type","restapi","uuid","items"],"additionalProperties":false},"description":"Devices section."},"bindings":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"bind":{"type":"string","const":"unicast"},"src.ep":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number","minimum":0,"maximum":255}],"description":"Source endpoint."},"dst.ep":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number","minimum":0,"maximum":255}],"description":"Destination endpoint, generaly 0x01."},"cl":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$","description":"Cluster."},"report":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"},"dt":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},"mf":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"},"min":{"type":"number"},"max":{"type":"number"},"change":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]+$"},{"type":"number"}]}},"required":["at","dt","min","max"],"additionalProperties":false}}},"required":["bind","src.ep","cl"],"additionalProperties":false},{"type":"object","properties":{"bind":{"type":"string","const":"groupcast"},"src.ep":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number","minimum":0,"maximum":255}],"description":"Source endpoint."},"cl":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$","description":"Cluster."},"config.group":{"type":"number","minimum":0,"maximum":255}},"required":["bind","src.ep","cl","config.group"],"additionalProperties":false}]},"description":"Bindings section."}},"required":["schema","manufacturername","modelid","status","subdevices"],"additionalProperties":false},{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"constants1.schema.json"},"ddfvalidate":{"type":"boolean"},"manufacturers":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"pattern":"^\\$MF\\_"}},"device-types":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"pattern":"^\\$TYPE\\_"}}},"required":["schema","manufacturers","device-types"],"additionalProperties":false},{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"constants2.schema.json"},"ddfvalidate":{"type":"boolean"}},"required":["schema"],"additionalProperties":true},{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"resourceitem1.schema.json"},"id":{"type":"string"},"ddfvalidate":{"type":"boolean"},"description":{"type":"string","description":"Item description, better to do not use it."},"comment":{"type":"string","description":"TODO: What is this ? What the difference with description ?"},"deprecated":{"type":"string","pattern":"^(\\d{4})-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:0[1-9])|(?:[12][0-9])|(?:3[01]))$","description":"Date of deprecation, if the item is deprecated, it's better to use the new one."},"datatype":{"type":"string","enum":["String","Bool","Int8","Int16","Int32","Int64","UInt8","UInt16","UInt32","UInt64","Double","Array","Array[3]","ISO 8601 timestamp"],"description":"Data type of the item."},"access":{"type":"string","enum":["R","W","RW"],"description":"Access mode for this item, some of them are not editable."},"public":{"type":"boolean","description":"Item visible on the API."},"implicit":{"type":"boolean","description":"TODO: What is this ?"},"managed":{"type":"boolean","description":"TODO: What is this ?"},"awake":{"type":"boolean","description":"The device is considered awake when this item is set due a incoming command."},"static":{"type":["string","number","boolean"],"description":"A static default value is fixed and can be not changed."},"range":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}],"description":"Values range limit."},"virtual":{"type":"boolean","description":"TODO: What is this ?"},"read":{"anyOf":[{"type":"object","properties":{"fn":{"type":"string","const":"none"}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"not":{},"description":"Generic function to read ZCL attributes."}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"tuya","description":"Generic function to read all Tuya datapoints. It has no parameters."}},"required":["fn"],"additionalProperties":false}],"description":"Fonction used to read value."},"parse":{"anyOf":[{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"not":{},"description":"Generic function to read ZCL attributes."},"cppsrc":{"type":"string"}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"ias:zonestatus","description":"Generic function to parse IAS ZONE status change notifications or zone status from read/report command."},"mask":{"anyOf":[{"type":"string","enum":["alarm1","alarm2"]},{"type":"string","const":"alarm1,alarm2"}],"description":"Sets the bitmask for Alert1 and Alert2 item of the IAS Zone status."}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"numtostr","description":"Generic function to to convert number to string."},"srcitem":{"type":"string","enum":["state/y","state/x","state/windowopen","state/water","state/water_bis","state/voltage","state/vibrationstrength","state/vibration","state/valve","state/utc","state/tiltangle","state/tilt","state/test","state/temperature","state/temperature_bis","state/targetdistance","state/tampered","state/speed","state/seconds_remaining","state/sat","state/rotaryevent","state/replacefilter","state/reachable","state/production","state/pressure","state/pressure_bis","state/presenceevent","state/presence","state/power","state/pm2_5","state/panel","state/orientation_z","state/orientation_y","state/orientation_x","state/open","state/open_bis","state/on","state/music_sync","state/mountingmodeactive","state/moisture","state/measured_value","state/lux","state/lowbattery","state/lockstate","state/localtime","state/lightlevel","state/lift","state/lastupdated","state/lastset","state/lastcheckin","state/humidity","state/humidity_bis","state/hue","state/heating","state/gradient","state/gesture","state/fire","state/filterruntime","state/expectedrotation","state/expectedeventduration","state/eventduration","state/errorcode","state/effect","state/deviceruntime","state/daylight","state/dark","state/current_P3","state/current_P2","state/current_P1","state/current","state/ct","state/consumption","state/consumption_2","state/colormode","state/charging","state/carbonmonoxide","state/buttonevent","state/bri","state/battery","state/angle","state/alert","state/alarm","state/airqualityppb","state/airqualityppb_bis","state/airquality","state/airquality_bis","state/action","config/windowopen_set","config/windowcoveringtype","config/volume","config/usertest","config/unoccupiedheatsetpoint","config/tuya_unlock","config/triggerdistance","config/triggerdistance_bis","config/tholdoffset","config/tholddark","config/temperature","config/swingmode","config/speed","config/sensitivitymax","config/sensitivity","config/sensitivity_bis","config/selftest","config/schedule_on","config/schedule","config/reversed","config/resetpresence","config/reportgrid","config/reachable","config/pulseconfiguration","config/preset","config/pending","config/on/startup","config/on","config/offset","config/mountingmode","config/mode","config/melody","config/locked","config/lock","config/ledindication","config/interfacemode","config/heatsetpoint","config/group","config/filterlifetime","config/fanmode","config/fadingtime","config/externalwindowopen","config/externalsensortemp","config/enrolled","config/duration","config/displayflipped","config/devicemode","config/devicemode_bis","config/delay","config/ctmin","config/ctmax","config/coolsetpoint","config/controlsequence","config/configured","config/colorcapabilities","config/color/xy/startup_y","config/color/xy/startup_x","config/color/gradient/reversed","config/color/gradient/pixel_count","config/color/execute_if_off","config/color/ct/startup","config/clickmode","config/checkin","config/bri/startup","config/bri/onoff_transitiontime","config/bri/on_level","config/bri/min","config/bri/max","config/bri/execute_if_off","config/battery","config/battery_bis","config/allowtouchlink","config/alert","cap/transition_block","cap/sleeper","cap/on/off_with_effect","cap/measured_value/unit","cap/measured_value/substance","cap/measured_value/quantity","cap/measured_value/min","cap/measured_value/max","cap/groups/not_supported","cap/group","cap/color/xy/red_y","cap/color/xy/red_x","cap/color/xy/green_y","cap/color/xy/green_x","cap/color/xy/blue_y","cap/color/xy/blue_x","cap/color/gradient/styles","cap/color/gradient/pixel_length","cap/color/gradient/pixel_count","cap/color/gradient/max_segments","cap/color/gamut_type","cap/color/effects","cap/color/ct/min","cap/color/ct/max","cap/color/ct/computes_xy","cap/color/capabilities","cap/bri/move_with_onoff","cap/bri/min_dim_level","cap/alert/trigger_effect","attr/uniqueid","attr/type","attr/swversion","attr/swversion_bis","attr/swconfigid","attr/productname","attr/productid","attr/powerup","attr/poweronlevel","attr/poweronct","attr/name","attr/modelid","attr/mode","attr/manufacturername","attr/lastseen","attr/lastannounced","attr/id"],"description":"The source item holding the number."},"op":{"type":"string","enum":["lt","le","eq","gt","ge"],"description":"Comparison operator (lt | le | eq | gt | ge)"},"to":{"description":"Array of (num, string) mappings"}},"required":["fn","srcitem","op","to"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"time","description":"Specialized function to parse time, local and last set time from read/report commands of the time cluster and auto-sync time if needed."}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"xiaomi:special","description":"Generic function to parse custom Xiaomi attributes and commands."},"idx":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"A 8-bit string hex value."}},"required":["fn","idx"],"additionalProperties":false},{"type":"object","properties":{"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"tuya","description":"Generic function to parse Tuya data."},"dpid":{"type":"number","description":"Data point ID. 1-255 the datapoint ID."}},"required":["fn","dpid"],"additionalProperties":false}],"description":"Fonction used to parse incoming values."},"write":{"anyOf":[{"type":"object","properties":{"fn":{"type":"string","const":"none"}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"not":{},"description":"Generic function to read ZCL attributes."},"cppsrc":{"type":"string"}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"tuya","description":"Generic function to write Tuya data."},"dpid":{"type":"number","description":"Data point ID. 1-255 the datapoint ID."},"dt":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"Data type."}},"required":["fn","dpid","dt"],"additionalProperties":false}],"description":"Fonction used to write value."},"refresh.interval":{"type":"number","description":"Refresh interval used for read fonction, NEED to be superior at value used in binding part."},"values":{"description":"TODO: What is this ?"},"default":{"description":"Defaut value."}},"required":["schema","id"],"additionalProperties":false},{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"subdevice1.schema.json"},"ddfvalidate":{"type":"boolean"},"type":{"anyOf":[{"type":"string","enum":["$TYPE_AIR_PURIFIER","$TYPE_AIR_QUALITY_SENSOR","$TYPE_CARBONDIOXIDE_SENSOR","$TYPE_CARBONMONOXIDE_SENSOR","$TYPE_FORMALDEHYDE_SENSOR","$TYPE_PARTICULATEMATTER_SENSOR","$TYPE_ALARM_SENSOR","$TYPE_ANCILLARY_CONTROL","$TYPE_BATTERY_SENSOR","$TYPE_COLOR_LIGHT","$TYPE_COLOR_TEMPERATURE_LIGHT","$TYPE_CONSUMPTION_SENSOR","$TYPE_DIMMABLE_LIGHT","$TYPE_DIMMABLE_PLUGIN_UNIT","$TYPE_DIMMER_SWITCH","$TYPE_DOOR_LOCK","$TYPE_DOOR_LOCK_CONTROLLER","$TYPE_DOOR_LOCK_SENSOR","$TYPE_EXTENDED_COLOR_LIGHT","$TYPE_FIRE_SENSOR","$TYPE_HUMIDITY_SENSOR","$TYPE_LEVEL_CONTROL_SWITCH","$TYPE_LIGHT_LEVEL_SENSOR","$TYPE_MOISTURE_SENSOR","$TYPE_ON_OFF_LIGHT","$TYPE_ON_OFF_LIGHT_SWITCH","$TYPE_ON_OFF_OUTPUT","$TYPE_ON_OFF_PLUGIN_UNIT","$TYPE_ON_OFF_SWITCH","$TYPE_OPEN_CLOSE_SENSOR","$TYPE_POWER_SENSOR","$TYPE_PRESENCE_SENSOR","$TYPE_PRESSURE_SENSOR","$TYPE_RANGE_EXTENDER","$TYPE_RELATIVE_ROTARY","$TYPE_SMART_PLUG","$TYPE_SPECTRAL_SENSOR","$TYPE_SWITCH","$TYPE_TEMPERATURE_SENSOR","$TYPE_THERMOSTAT","$TYPE_TIME","$TYPE_VIBRATION_SENSOR","$TYPE_WARNING_DEVICE","$TYPE_WATER_LEAK_SENSOR","$TYPE_WINDOW_COVERING_DEVICE","$TYPE_ZGP_SWITCH"]},{"type":"string","pattern":"^(?!\\$TYPE_).*"}]},"name":{"type":"string"},"restapi":{"type":"string","enum":["/lights","/sensors"]},"order":{"type":"number"},"uuid":{"anyOf":[{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"string","const":"$address.ext"},{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"}]},{"type":"array","minItems":3,"maxItems":3,"items":[{"type":"string","const":"$address.ext"},{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"}]}]},"items":{"type":"array","items":{"type":"string","enum":["state/y","state/x","state/windowopen","state/water","state/water_bis","state/voltage","state/vibrationstrength","state/vibration","state/valve","state/utc","state/tiltangle","state/tilt","state/test","state/temperature","state/temperature_bis","state/targetdistance","state/tampered","state/speed","state/seconds_remaining","state/sat","state/rotaryevent","state/replacefilter","state/reachable","state/production","state/pressure","state/pressure_bis","state/presenceevent","state/presence","state/power","state/pm2_5","state/panel","state/orientation_z","state/orientation_y","state/orientation_x","state/open","state/open_bis","state/on","state/music_sync","state/mountingmodeactive","state/moisture","state/measured_value","state/lux","state/lowbattery","state/lockstate","state/localtime","state/lightlevel","state/lift","state/lastupdated","state/lastset","state/lastcheckin","state/humidity","state/humidity_bis","state/hue","state/heating","state/gradient","state/gesture","state/fire","state/filterruntime","state/expectedrotation","state/expectedeventduration","state/eventduration","state/errorcode","state/effect","state/deviceruntime","state/daylight","state/dark","state/current_P3","state/current_P2","state/current_P1","state/current","state/ct","state/consumption","state/consumption_2","state/colormode","state/charging","state/carbonmonoxide","state/buttonevent","state/bri","state/battery","state/angle","state/alert","state/alarm","state/airqualityppb","state/airqualityppb_bis","state/airquality","state/airquality_bis","state/action","config/windowopen_set","config/windowcoveringtype","config/volume","config/usertest","config/unoccupiedheatsetpoint","config/tuya_unlock","config/triggerdistance","config/triggerdistance_bis","config/tholdoffset","config/tholddark","config/temperature","config/swingmode","config/speed","config/sensitivitymax","config/sensitivity","config/sensitivity_bis","config/selftest","config/schedule_on","config/schedule","config/reversed","config/resetpresence","config/reportgrid","config/reachable","config/pulseconfiguration","config/preset","config/pending","config/on/startup","config/on","config/offset","config/mountingmode","config/mode","config/melody","config/locked","config/lock","config/ledindication","config/interfacemode","config/heatsetpoint","config/group","config/filterlifetime","config/fanmode","config/fadingtime","config/externalwindowopen","config/externalsensortemp","config/enrolled","config/duration","config/displayflipped","config/devicemode","config/devicemode_bis","config/delay","config/ctmin","config/ctmax","config/coolsetpoint","config/controlsequence","config/configured","config/colorcapabilities","config/color/xy/startup_y","config/color/xy/startup_x","config/color/gradient/reversed","config/color/gradient/pixel_count","config/color/execute_if_off","config/color/ct/startup","config/clickmode","config/checkin","config/bri/startup","config/bri/onoff_transitiontime","config/bri/on_level","config/bri/min","config/bri/max","config/bri/execute_if_off","config/battery","config/battery_bis","config/allowtouchlink","config/alert","cap/transition_block","cap/sleeper","cap/on/off_with_effect","cap/measured_value/unit","cap/measured_value/substance","cap/measured_value/quantity","cap/measured_value/min","cap/measured_value/max","cap/groups/not_supported","cap/group","cap/color/xy/red_y","cap/color/xy/red_x","cap/color/xy/green_y","cap/color/xy/green_x","cap/color/xy/blue_y","cap/color/xy/blue_x","cap/color/gradient/styles","cap/color/gradient/pixel_length","cap/color/gradient/pixel_count","cap/color/gradient/max_segments","cap/color/gamut_type","cap/color/effects","cap/color/ct/min","cap/color/ct/max","cap/color/ct/computes_xy","cap/color/capabilities","cap/bri/move_with_onoff","cap/bri/min_dim_level","cap/alert/trigger_effect","attr/uniqueid","attr/type","attr/swversion","attr/swversion_bis","attr/swconfigid","attr/productname","attr/productid","attr/powerup","attr/poweronlevel","attr/poweronct","attr/name","attr/modelid","attr/mode","attr/manufacturername","attr/lastseen","attr/lastannounced","attr/id"]}},"items_optional":{"$ref":"#/definitions/DDF/anyOf/4/properties/items"}},"required":["schema","type","name","restapi","order","uuid","items"],"additionalProperties":false}]}},"$schema":"http://json-schema.org/draft-07/schema#"}
1
+ {"$ref":"#/definitions/DDF","definitions":{"DDF":{"anyOf":[{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"devcap1.schema.json"},"uuid":{"type":"string"},"ddfvalidate":{"type":"boolean"},"version":{"type":"string"},"version_deconz":{"type":"string"},"doc:path":{"type":"string"},"doc:hdr":{"type":"string"},"md:changelogs":{"type":"array","items":{"type":"string"},"description":"Changelogs for this device, markdown file."},"md:info":{"type":"array","items":{"type":"string"},"description":"Notes info for this device, markdown file."},"md:warning":{"type":"array","items":{"type":"string"},"description":"Notes warning for this device, markdown file."},"md:known_issues":{"type":"array","items":{"type":"string"},"description":"Know issues for this device, markdown file."},"manufacturername":{"anyOf":[{"type":"string","enum":["$MF_AQARA","$MF_BOSCH","$MF_IKEA","$MF_LUMI","$MF_LUTRON","$MF_PHILIPS","$MF_SAMJIN","$MF_SIGNIFY","$MF_TUYA","$MF_XIAOMI"]},{"type":"string","pattern":"^(?!\\$MF_).*"},{"type":"array","items":{"anyOf":[{"type":"string","enum":["$MF_AQARA","$MF_BOSCH","$MF_IKEA","$MF_LUMI","$MF_LUTRON","$MF_PHILIPS","$MF_SAMJIN","$MF_SIGNIFY","$MF_TUYA","$MF_XIAOMI"]},{"type":"string","pattern":"^(?!\\$MF_).*"}]}}],"description":"Manufacturer name from Basic Cluster."},"modelid":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Model ID from Basic Cluster."},"vendor":{"type":"string","description":"Friendly name of the manufacturer."},"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#"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),G="2.29.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),G="2.30.0",w={"devcap1.schema.json":[M,P,W,L,R,Y],"constants2.schema.json":[N]};function M(t,r,u){const i=typeof t.manufacturername=="string"&&typeof t.modelid=="string";if(i)return;const c=Array.isArray(t.manufacturername)&&Array.isArray(t.modelid);if(c&&t.manufacturername.length!==t.modelid.length){r.addIssue({code:e.z.ZodIssueCode.invalid_intersection_types,message:"When 'manufacturername' and 'modelid' are both arrays they should be the same length",path:["manufacturername","modelid"]});return}(i||c)===!1&&r.addIssue({code:e.z.ZodIssueCode.invalid_intersection_types,message:"Invalid properties 'manufacturername' and 'modelid' should have the same type",path:["manufacturername","modelid"]})}function P(t,r,u){if(!t.bindings)return;const i=n=>`0x${(typeof n=="number"?n:Number.parseInt(n,16)).toString(16)}`,c={};t.bindings.forEach(n=>{n.bind==="unicast"&&n.report&&n.report.forEach(d=>{d.max!==65535&&(c[`${i(n["src.ep"])}.${i(n.cl)}.${i(d.at)}`]=d.max)})}),t.subdevices.forEach((n,d)=>{n.items.forEach((a,m)=>{var s;if(a["refresh.interval"]&&a.read&&a.read.fn==="zcl:attr"&&a.read.at){const o=i(a.read.ep??((s=n.fingerprint)==null?void 0:s.endpoint)??n.uuid[1]),p=Array.isArray(a.read.at)?a.read.at:[a.read.at];for(let h=0;h<p.length;h++){const z=`${o}.${i(a.read.cl)}.${i(p[h])}`;c[z]!==void 0&&a["refresh.interval"]-60<c[z]&&r.addIssue({code:e.z.ZodIssueCode.custom,message:`The refresh interval (${a["refresh.interval"]} - 60 = ${a["refresh.interval"]-60}) should be greater than the binding max refresh value (${c[z]}) with a margin of 60 seconds`,path:["subdevices",d,"items",m,"refresh.interval"]})}}})})}function W(t,r,u){const i=[{description:'a device with "state/ct" need the "min" and "max" values for capability.',if:{item:"state/ct"},need:{item:["cap/color/ct/min","cap/color/ct/max"]}},{description:'a device with "cap/color/ct/computes_xy" need the corresponding state/{x,y} items',if:{item:"cap/color/ct/computes_xy"},need:{item:["state/x","state/y","state/ct"]}},{description:'a device with "state/x" or "state/y" need the corresponding cap/color/xy/{red,green,blue}/{x,y} items',if:{item:{or:["state/x","state/y"]}},need:{item:["state/x","state/y","cap/color/xy/red_x","cap/color/xy/green_x","cap/color/xy/blue_x","cap/color/xy/red_y","cap/color/xy/green_y","cap/color/xy/blue_y"]}},{description:'a "(Extended) Color light" need ("state/x" and "state/y") or/and ("state/hue" and "state/sat") .',if:{type:{or:["$TYPE_EXTENDED_COLOR_LIGHT","Extended color light","$TYPE_COLOR_LIGHT","Color light"]}},need:{item:{or:[["state/x","state/y"],["state/hue","state/sat"]]}}}],c=(n,d)=>typeof n=="string"?d(n):Array.isArray(n)?n.every(a=>c(a,d)):"and"in n?n.and.every(a=>c(a,d)):"or"in n?n.or.some(a=>c(a,d)):!1;t.subdevices.forEach((n,d)=>{const a=n.items.map(m=>m.name);i.forEach(m=>{(Object.keys(m.if).length===0||Object.entries(m.if).some(([s,o])=>{switch(s){case"type":return c(o,p=>p===n.type);case"item":return c(o,p=>a.includes(p));default:return!1}}))&&(c(m.need.item,s=>a.includes(s))||r.addIssue({code:e.z.ZodIssueCode.custom,message:`The device is missing some items because ${m.description}`,path:["subdevices",d,"items"]}))})})}function L(t,r,u){const i=["parse","write"];t.subdevices.forEach((c,n)=>{c.items.forEach((d,a)=>{i.forEach(m=>{const s=d[m];s!==void 0&&(s.fn===void 0||s.fn==="zcl:attr"||s.fn==="zcl:cmd")&&(s.eval===void 0&&s.script===void 0&&r.addIssue({code:e.z.ZodIssueCode.custom,message:`The '${m}' function is missing 'eval' or 'script' option.`,path:["subdevices",n,"items",a,m]}),s.eval!==void 0&&s.script!==void 0&&r.addIssue({code:e.z.ZodIssueCode.custom,message:`The '${m}' function is having both 'eval' and 'script' option.`,path:["subdevices",n,"items",a,m]}))})})})}function N(t,r,u){const i=D();Object.keys(t).forEach(c=>{if(!Object.keys(i.shape).includes(c)){if(!["$MF_","$TYPE_"].some(n=>c.startsWith(n))){r.addIssue({code:e.z.ZodIssueCode.custom,message:"The constant key should start with '$MF_' or '$TYPE_'",path:[c]});return}typeof t[c]!="string"&&r.addIssue({code:e.z.ZodIssueCode.custom,message:"The constant value should be a string",path:[c]})}})}function R(t,r,u){t.subdevices.forEach((i,c)=>{const n=u.subDevices[i.type];if(!n){r.addIssue({code:e.z.ZodIssueCode.custom,message:`The device is missing the device definition (subdevice1.schema.json) for the type "${i.type}"`,path:["subdevices",c,"items"]});return}let d=n.items;n.items_optional&&(d=d.filter(a=>!n.items_optional.includes(a))),d.forEach(a=>{i.items.find(m=>m.name===a)||r.addIssue({code:e.z.ZodIssueCode.custom,message:`The device should have the item "${a}" because it is mandatory for devices of type "${i.type}"`,path:["subdevices",c,"items"]})})})}function Y(t,r,u){t.subdevices.forEach((i,c)=>{const n=i.items.map(d=>d.name);i.items.forEach((d,a)=>{d.parse&&d.parse.fn==="numtostr"&&(n.includes(d.parse.srcitem)||r.addIssue({code:e.z.ZodIssueCode.custom,message:`The device should have the item "${d.parse.srcitem}" because it is used in the 'numtostr' function`,path:["subdevices",c,"items",a,"parse","srcitem"]}))})})}function B(t){return e.z.strictObject({$schema:e.z.optional(e.z.string()),schema:e.z.literal("constants1.schema.json"),ddfvalidate:e.z.optional(e.z.boolean()),manufacturers:e.z.record(e.z.string().startsWith("$MF_"),e.z.string()),"device-types":e.z.record(e.z.string().startsWith("$TYPE_"),e.z.string())})}function D(t){return e.z.object({$schema:e.z.optional(e.z.string()),schema:e.z.literal("constants2.schema.json"),ddfvalidate:e.z.optional(e.z.boolean())}).passthrough()}function U(){return e.z.string().regex(/^(\d{4})-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:0[1-9])|(?:[12][0-9])|(?:3[01]))$/,"Invalid date value")}function l(t=void 0){const r="Invalid hexadecimal value";return t===void 0?e.z.string().regex(/^0x[0-9a-fA-F]+$/,r):e.z.string().regex(new RegExp(`^0x[0-9a-fA-F]{${t}}$`),r)}function v(){return e.z.union([l(2),e.z.number().min(0).max(255)])}function k(){return e.z.custom(t=>{if(!Array.isArray(t)||t.length%2!==0)return!1;for(let r=0;r<t.length;r+=2){const u=t[r],i=t[r+1];if(typeof u!="number"||typeof i!="string")return!1}return!0},"The value must be an array with an even number of values and alternating between number and string.")}function S(){return e.z.union([e.z.tuple([e.z.literal("$address.ext"),l(2)]),e.z.tuple([e.z.literal("$address.ext"),l(2),l(4)])])}function C(){return e.z.string()}function A(){return e.z.string()}const y=e.z.strictObject({ep:e.z.optional(v()).describe("Endpoint, 255 means any endpoint, 0 means auto selected from subdevice."),cl:l(4).describe("Cluster ID."),at:e.z.optional(l(4).or(e.z.array(l(4)))).describe("Attribute ID."),mf:e.z.optional(l(4)).describe("Manufacturer code, must be set to 0x0000 for non manufacturer specific commands."),cmd:e.z.optional(e.z.union([e.z.literal("any"),l(2)])).describe("Zigbee command."),fc:e.z.optional(l(2).or(e.z.number())).describe("Zigbee command frame control."),eval:e.z.optional(A()).describe("Javascript expression to transform the attribute value to the Item value."),script:e.z.optional(C()).describe("Relative path of a Javascript .js file.")}),f={read:y.extend({}),parse:y.extend({}),write:y.extend({"state.timeout":e.z.optional(e.z.number()),"change.timeout":e.z.optional(e.z.number()),dt:e.z.optional(l(2)).describe("Data type.")})};function V(){return e.z.discriminatedUnion("fn",[e.z.strictObject({fn:e.z.literal("none")}),f.read.extend({fn:e.z.undefined().describe("Generic function to read ZCL attributes.")}),f.read.extend({fn:e.z.literal("zcl:attr").describe("Generic function to parse ZCL values from read/report commands.")}),f.read.extend({fn:e.z.literal("zcl:cmd").describe("Generic function to parse ZCL values from read/report commands.")}),e.z.strictObject({fn:e.z.literal("tuya").describe("Generic function to read all Tuya datapoints. It has no parameters.")})]).refine(t=>!("eval"in t&&"script"in t),{message:"eval and script should not both be present"})}function q(t){return e.z.discriminatedUnion("fn",[f.parse.extend({fn:e.z.undefined().describe("Generic function to read ZCL attributes."),cppsrc:e.z.optional(e.z.string())}),f.parse.extend({fn:e.z.literal("zcl:attr").describe("Generic function to parse ZCL values from read/report commands.")}),f.parse.extend({fn:e.z.literal("zcl:cmd").describe("Generic function to parse ZCL values from read/report commands.")}),e.z.strictObject({fn:e.z.literal("ias:zonestatus").describe("Generic function to parse IAS ZONE status change notifications or zone status from read/report command."),mask:e.z.optional(e.z.enum(["alarm1","alarm2"]).or(e.z.literal("alarm1,alarm2"))).describe("Sets the bitmask for Alert1 and Alert2 item of the IAS Zone status.")}),e.z.strictObject({fn:e.z.literal("numtostr").describe("Generic function to to convert number to string."),srcitem:e.z.enum(t.attributes,{errorMap:(r,u)=>r.code==="invalid_enum_value"?{message:`Invalid enum value. Expected item from generic attributes definition, received '${r.received}'`}:{message:u.defaultError}}).describe("The source item holding the number."),op:e.z.enum(["lt","le","eq","gt","ge"]).describe("Comparison operator (lt | le | eq | gt | ge)"),to:k().describe("Array of (num, string) mappings")}),e.z.strictObject({fn:e.z.literal("time").describe("Specialized function to parse time, local and last set time from read/report commands of the time cluster and auto-sync time if needed.")}),f.parse.pick({ep:!0,at:!0,mf:!0,eval:!0,script:!0}).extend({fn:e.z.literal("xiaomi:special").describe("Generic function to parse custom Xiaomi attributes and commands."),idx:l(2).describe("A 8-bit string hex value.")}),f.parse.pick({eval:!0,script:!0}).extend({fn:e.z.literal("tuya").describe("Generic function to parse Tuya data."),dpid:e.z.number().describe("Data point ID. 1-255 the datapoint ID.")})]).refine(r=>!("eval"in r&&"script"in r),{message:"eval and script should not both be present"})}function H(){return e.z.discriminatedUnion("fn",[e.z.strictObject({fn:e.z.literal("none")}),f.write.extend({fn:e.z.undefined().describe("Generic function to read ZCL attributes."),cppsrc:e.z.optional(e.z.string())}),f.write.extend({fn:e.z.literal("zcl:attr").describe("Generic function to parse ZCL values from read/report commands.")}),f.write.extend({fn:e.z.literal("zcl:cmd").describe("Generic function to parse ZCL values from read/report commands.")}),f.write.pick({eval:!0,script:!0}).extend({fn:e.z.literal("tuya").describe("Generic function to write Tuya data."),dpid:e.z.number().describe("Data point ID. 1-255 the datapoint ID."),dt:l(2).describe("Data type.")})]).refine(t=>!("eval"in t&&"script"in t),{message:"eval and script should not both be present"})}function F(t){return e.z.strictObject({$schema:e.z.optional(e.z.string()),schema:e.z.literal("resourceitem1.schema.json"),id:e.z.string(),ddfvalidate:e.z.optional(e.z.boolean()),description:e.z.optional(e.z.string()).describe("Item description, better to do not use it."),comment:e.z.optional(e.z.string()).describe("TODO: What is this ? What the difference with description ?"),deprecated:e.z.optional(U()).describe("Date of deprecation, if the item is deprecated, it's better to use the new one."),datatype:e.z.optional(e.z.enum(["String","Bool","Int8","Int16","Int32","Int64","UInt8","UInt16","UInt32","UInt64","Double","Array","Array[3]","ISO 8601 timestamp"])).describe("Data type of the item."),access:e.z.optional(e.z.enum(["R","W","RW"])).describe("Access mode for this item, some of them are not editable."),public:e.z.optional(e.z.boolean()).describe("Item visible on the API."),implicit:e.z.optional(e.z.boolean()).describe("TODO: What is this ?"),managed:e.z.optional(e.z.boolean()).describe("TODO: What is this ?"),awake:e.z.optional(e.z.boolean()).describe("The device is considered awake when this item is set due a incoming command."),static:e.z.optional(e.z.union([e.z.string(),e.z.number(),e.z.boolean()])).describe("A static default value is fixed and can be not changed."),range:e.z.optional(e.z.tuple([e.z.number(),e.z.number()])).describe("Values range limit."),virtual:e.z.optional(e.z.boolean()).describe("TODO: What is this ?"),read:e.z.optional(V()).describe("Fonction used to read value."),parse:e.z.optional(q(t)).describe("Fonction used to parse incoming values."),write:e.z.optional(H()).describe("Fonction used to write value."),"refresh.interval":e.z.optional(e.z.number()).describe("Refresh interval used for read fonction, NEED to be superior at value used in binding part."),values:e.z.optional(e.z.unknown()).describe("TODO: What is this ?"),default:e.z.optional(e.z.unknown()).describe("Defaut value.")})}function J(t){return e.z.strictObject({$schema:e.z.optional(e.z.string()),schema:e.z.literal("devcap1.schema.json"),uuid:e.z.optional(e.z.string()),ddfvalidate:e.z.optional(e.z.boolean()),version:e.z.optional(e.z.string()),version_deconz:e.z.optional(e.z.string()),"doc:path":e.z.optional(e.z.string()),"doc:hdr":e.z.optional(e.z.string()),"md:changelogs":e.z.optional(e.z.array(e.z.string())).describe("Changelogs for this device, markdown file."),"md:info":e.z.optional(e.z.array(e.z.string())).describe("Notes info for this device, markdown file."),"md:warning":e.z.optional(e.z.array(e.z.string())).describe("Notes warning for this device, markdown file."),"md:known_issues":e.z.optional(e.z.array(e.z.string())).describe("Know issues for this device, markdown file."),manufacturername:e.z.union([e.z.enum(Object.keys(t.manufacturers)),e.z.string().regex(/^(?!\$MF_).*/g,"The manufacturer name start with $MF_ but is not present in constants.json"),e.z.array(e.z.union([e.z.enum(Object.keys(t.manufacturers)),e.z.string().regex(/^(?!\$MF_).*/g,"The manufacturer name start with $MF_ but is not present in constants.json")]))]).describe("Manufacturer name from Basic Cluster."),modelid:e.z.string().or(e.z.array(e.z.string())).describe("Model ID from Basic Cluster."),vendor:e.z.optional(e.z.string()).describe("Friendly name of the manufacturer."),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;
@@ -9,6 +9,12 @@ export type DDF = {
9
9
  version_deconz?: string | undefined;
10
10
  "doc:path"?: string | undefined;
11
11
  "doc:hdr"?: string | undefined;
12
+ /** Changelogs for this device, markdown file. */
13
+ "md:changelogs"?: string[] | undefined;
14
+ /** Notes info for this device, markdown file. */
15
+ "md:info"?: string[] | undefined;
16
+ /** Notes warning for this device, markdown file. */
17
+ "md:warning"?: string[] | undefined;
12
18
  /** Know issues for this device, markdown file. */
13
19
  "md:known_issues"?: string[] | undefined;
14
20
  /** Manufacturer name from Basic Cluster. */
@@ -1,15 +1,15 @@
1
1
  import { z as e } from "zod";
2
- const M = "2.29.0", O = {
2
+ const M = "2.30.0", O = {
3
3
  "devcap1.schema.json": [
4
4
  z,
5
5
  P,
6
6
  W,
7
7
  L,
8
- N,
8
+ R,
9
9
  Y
10
10
  ],
11
11
  "constants2.schema.json": [
12
- R
12
+ N
13
13
  ]
14
14
  };
15
15
  function z(t, r, u) {
@@ -187,7 +187,7 @@ function L(t, r, u) {
187
187
  });
188
188
  });
189
189
  }
190
- function R(t, r, u) {
190
+ function N(t, r, u) {
191
191
  const i = C();
192
192
  Object.keys(t).forEach((c) => {
193
193
  if (!Object.keys(i.shape).includes(c)) {
@@ -207,7 +207,7 @@ function R(t, r, u) {
207
207
  }
208
208
  });
209
209
  }
210
- function N(t, r, u) {
210
+ function R(t, r, u) {
211
211
  t.subdevices.forEach((i, c) => {
212
212
  const n = u.subDevices[i.type];
213
213
  if (!n) {
@@ -465,6 +465,9 @@ function J(t) {
465
465
  version_deconz: e.optional(e.string()),
466
466
  "doc:path": e.optional(e.string()),
467
467
  "doc:hdr": e.optional(e.string()),
468
+ "md:changelogs": e.optional(e.array(e.string())).describe("Changelogs for this device, markdown file."),
469
+ "md:info": e.optional(e.array(e.string())).describe("Notes info for this device, markdown file."),
470
+ "md:warning": e.optional(e.array(e.string())).describe("Notes warning for this device, markdown file."),
468
471
  "md:known_issues": e.optional(e.array(e.string())).describe("Know issues for this device, markdown file."),
469
472
  manufacturername: e.union([
470
473
  e.enum(Object.keys(t.manufacturers)),
@@ -650,11 +653,11 @@ function re(t = {
650
653
  }, d = (m) => r.parse(m);
651
654
  return { generics: t, loadGeneric: n, validate: d, bulkValidate: (m, s, o = {}) => {
652
655
  const p = (b, h) => {
653
- var j, E, T;
656
+ var j, E, w;
654
657
  let I = 0, _ = Number.POSITIVE_INFINITY, $ = b, v = [];
655
658
  for ((j = o.onSectionStart) == null || j.call(o, h, b.length); v = [], (E = o.onSectionProgress) == null || E.call(o, h, 1, b.length), $.forEach((y) => {
656
- var w;
657
- (w = o.onSectionProgress) == null || w.call(o, h, I++, b.length);
659
+ var T;
660
+ (T = o.onSectionProgress) == null || T.call(o, h, I++, b.length);
658
661
  try {
659
662
  h === "generic" ? n(y.data) : h === "ddf" && d(y.data);
660
663
  } catch (G) {
@@ -665,7 +668,7 @@ function re(t = {
665
668
  }
666
669
  }), !(v.length === 0 || v.length >= _); )
667
670
  I -= v.length, $ = v, _ = v.length;
668
- return (T = o.onSectionEnd) == null || T.call(o, h, b.length, v), v;
671
+ return (w = o.onSectionEnd) == null || w.call(o, h, b.length, v), v;
669
672
  };
670
673
  return [
671
674
  ...p(m, "generic"),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deconz-community/ddf-validator",
3
3
  "type": "module",
4
- "version": "2.29.0",
4
+ "version": "2.30.0",
5
5
  "description": "Validating DDF files for deconz",
6
6
  "author": {
7
7
  "name": "Zehir",
@@ -55,19 +55,19 @@
55
55
  "node": ">=16.0.0"
56
56
  },
57
57
  "dependencies": {
58
- "zod": "^3.23.7"
58
+ "zod": "^3.23.8"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/jsdom": "^21.1.6",
62
- "@types/node": "^20.12.11",
63
- "@typescript-eslint/eslint-plugin": "^7.8.0",
64
- "@typescript-eslint/parser": "^7.8.0",
62
+ "@types/node": "^20.12.12",
63
+ "@typescript-eslint/eslint-plugin": "^7.10.0",
64
+ "@typescript-eslint/parser": "^7.10.0",
65
65
  "degit": "^2.8.4",
66
- "eslint": "^9.2.0",
66
+ "eslint": "^9.3.0",
67
67
  "fast-glob": "^3.3.2",
68
- "lint-staged": "^15.2.2",
69
- "rimraf": "^5.0.5",
70
- "stylelint": "^16.5.0",
68
+ "lint-staged": "^15.2.5",
69
+ "rimraf": "^5.0.7",
70
+ "stylelint": "^16.6.0",
71
71
  "stylelint-config-recommended": "^14.0.0",
72
72
  "stylelint-config-sass-guidelines": "^11.1.0",
73
73
  "taze": "^0.13.8",
@@ -77,7 +77,7 @@
77
77
  "vitest": "^1.6.0",
78
78
  "zod-to-json-schema": "^3.23.0",
79
79
  "zod-to-ts": "^1.2.0",
80
- "zod-validation-error": "^3.2.0"
80
+ "zod-validation-error": "^3.3.0"
81
81
  },
82
82
  "scripts": {
83
83
  "build": "pnpm run build:vite && pnpm run build:dts",