@deconz-community/ddf-validator 2.19.0 → 2.20.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"},"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":{"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":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"Zigbee command."},"eval":{"type":"string","description":"Javascript expression to transform the attribute value to the Item value."},"script":{"type":"string","description":"Relative path of a Javascript .js file."},"fc":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number"}],"description":"Zigbee command frame control."},"fn":{"not":{},"description":"Generic function to read ZCL attributes."}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"tuya","description":"Generic function to read all Tuya datapoints. It has no parameters."}},"required":["fn"],"additionalProperties":false}],"description":"Fonction used to read value."},"parse":{"anyOf":[{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"not":{},"description":"Generic function to read ZCL attributes."},"cppsrc":{"type":"string"}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"ias:zonestatus","description":"Generic function to parse IAS ZONE status change notifications or zone status from read/report command."},"mask":{"anyOf":[{"type":"string","enum":["alarm1","alarm2"]},{"type":"string","const":"alarm1,alarm2"}],"description":"Sets the bitmask for Alert1 and Alert2 item of the IAS Zone status."}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"numtostr","description":"Generic function to to convert number to string."},"srcitem":{"type":"string","enum":["state/y","state/x","state/windowopen","state/water","state/water_bis","state/voltage","state/vibrationstrength","state/vibration","state/valve","state/utc","state/tiltangle","state/tilt","state/test","state/temperature","state/temperature_bis","state/targetdistance","state/tampered","state/speed","state/seconds_remaining","state/sat","state/rotaryevent","state/replacefilter","state/reachable","state/production","state/pressure","state/pressure_bis","state/presenceevent","state/presence","state/power","state/pm2_5","state/panel","state/orientation_z","state/orientation_y","state/orientation_x","state/open","state/open_bis","state/on","state/music_sync","state/mountingmodeactive","state/moisture","state/measured_value","state/lux","state/lowbattery","state/lockstate","state/localtime","state/lightlevel","state/lift","state/lastupdated","state/lastset","state/lastcheckin","state/humidity","state/humidity_bis","state/hue","state/heating","state/gradient","state/gesture","state/fire","state/filterruntime","state/expectedrotation","state/expectedeventduration","state/eventduration","state/errorcode","state/effect","state/deviceruntime","state/daylight","state/dark","state/current_P3","state/current_P2","state/current_P1","state/current","state/ct","state/consumption","state/consumption_2","state/colormode","state/charging","state/carbonmonoxide","state/buttonevent","state/bri","state/battery","state/angle","state/alert","state/alarm","state/airqualityppb","state/airqualityppb_bis","state/airquality","state/airquality_bis","state/action","config/windowopen_set","config/windowcoveringtype","config/volume","config/usertest","config/unoccupiedheatsetpoint","config/tuya_unlock","config/triggerdistance","config/triggerdistance_bis","config/tholdoffset","config/tholddark","config/temperature","config/swingmode","config/speed","config/sensitivitymax","config/sensitivity","config/sensitivity_bis","config/selftest","config/schedule_on","config/schedule","config/reversed","config/resetpresence","config/reportgrid","config/reachable","config/pulseconfiguration","config/preset","config/pending","config/on/startup","config/on","config/offset","config/mountingmode","config/mode","config/melody","config/locked","config/lock","config/ledindication","config/interfacemode","config/heatsetpoint","config/group","config/filterlifetime","config/fanmode","config/fadingtime","config/externalwindowopen","config/externalsensortemp","config/enrolled","config/duration","config/displayflipped","config/devicemode","config/devicemode_bis","config/delay","config/ctmin","config/ctmax","config/coolsetpoint","config/controlsequence","config/configured","config/colorcapabilities","config/color/xy/startup_y","config/color/xy/startup_x","config/color/gradient/reversed","config/color/gradient/pixel_count","config/color/execute_if_off","config/color/ct/startup","config/clickmode","config/checkin","config/bri/startup","config/bri/onoff_transitiontime","config/bri/on_level","config/bri/min","config/bri/max","config/bri/execute_if_off","config/battery","config/battery_bis","config/allowtouchlink","config/alert","cap/transition_block","cap/sleeper","cap/on/off_with_effect","cap/measured_value/unit","cap/measured_value/substance","cap/measured_value/quantity","cap/measured_value/min","cap/measured_value/max","cap/groups/not_supported","cap/group","cap/color/xy/red_y","cap/color/xy/red_x","cap/color/xy/green_y","cap/color/xy/green_x","cap/color/xy/blue_y","cap/color/xy/blue_x","cap/color/gradient/styles","cap/color/gradient/pixel_length","cap/color/gradient/pixel_count","cap/color/gradient/max_segments","cap/color/gamut_type","cap/color/effects","cap/color/ct/min","cap/color/ct/max","cap/color/ct/computes_xy","cap/color/capabilities","cap/bri/move_with_onoff","cap/bri/min_dim_level","cap/alert/trigger_effect","attr/uniqueid","attr/type","attr/swversion","attr/swversion_bis","attr/swconfigid","attr/productname","attr/productid","attr/powerup","attr/poweronlevel","attr/poweronct","attr/name","attr/modelid","attr/mode","attr/manufacturername","attr/lastseen","attr/lastannounced","attr/id"],"description":"The source item holding the number."},"op":{"type":"string","enum":["lt","le","eq","gt","ge"],"description":"Comparison operator (lt | le | eq | gt | ge)"},"to":{"description":"Array of (num, string) mappings"}},"required":["fn","srcitem","op","to"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"time","description":"Specialized function to parse time, local and last set time from read/report commands of the time cluster and auto-sync time if needed."}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"xiaomi:special","description":"Generic function to parse custom Xiaomi attributes and commands."},"idx":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"A 8-bit string hex value."}},"required":["fn","idx"],"additionalProperties":false},{"type":"object","properties":{"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"tuya","description":"Generic function to parse Tuya data."},"dpid":{"type":"number","description":"Data point ID. 1-255 the datapoint ID."}},"required":["fn","dpid"],"additionalProperties":false}],"description":"Fonction used to parse incoming values."},"write":{"anyOf":[{"type":"object","properties":{"fn":{"type":"string","const":"none"}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"type":"number"},"change.timeout":{"type":"number"},"dt":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"Data type."},"fn":{"not":{},"description":"Generic function to read ZCL attributes."},"cppsrc":{"type":"string"}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"tuya","description":"Generic function to write Tuya data."},"dpid":{"type":"number","description":"Data point ID. 1-255 the datapoint ID."},"dt":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"Data type."}},"required":["fn","dpid","dt"],"additionalProperties":false}],"description":"Fonction used to write value."},"refresh.interval":{"type":"number","description":"Refresh interval used for read fonction, NEED to be superior at value used in binding part."},"values":{"description":"TODO: What is this ?"},"default":{"description":"Defaut value."},"name":{"type":"string","enum":["state/y","state/x","state/windowopen","state/water","state/water_bis","state/voltage","state/vibrationstrength","state/vibration","state/valve","state/utc","state/tiltangle","state/tilt","state/test","state/temperature","state/temperature_bis","state/targetdistance","state/tampered","state/speed","state/seconds_remaining","state/sat","state/rotaryevent","state/replacefilter","state/reachable","state/production","state/pressure","state/pressure_bis","state/presenceevent","state/presence","state/power","state/pm2_5","state/panel","state/orientation_z","state/orientation_y","state/orientation_x","state/open","state/open_bis","state/on","state/music_sync","state/mountingmodeactive","state/moisture","state/measured_value","state/lux","state/lowbattery","state/lockstate","state/localtime","state/lightlevel","state/lift","state/lastupdated","state/lastset","state/lastcheckin","state/humidity","state/humidity_bis","state/hue","state/heating","state/gradient","state/gesture","state/fire","state/filterruntime","state/expectedrotation","state/expectedeventduration","state/eventduration","state/errorcode","state/effect","state/deviceruntime","state/daylight","state/dark","state/current_P3","state/current_P2","state/current_P1","state/current","state/ct","state/consumption","state/consumption_2","state/colormode","state/charging","state/carbonmonoxide","state/buttonevent","state/bri","state/battery","state/angle","state/alert","state/alarm","state/airqualityppb","state/airqualityppb_bis","state/airquality","state/airquality_bis","state/action","config/windowopen_set","config/windowcoveringtype","config/volume","config/usertest","config/unoccupiedheatsetpoint","config/tuya_unlock","config/triggerdistance","config/triggerdistance_bis","config/tholdoffset","config/tholddark","config/temperature","config/swingmode","config/speed","config/sensitivitymax","config/sensitivity","config/sensitivity_bis","config/selftest","config/schedule_on","config/schedule","config/reversed","config/resetpresence","config/reportgrid","config/reachable","config/pulseconfiguration","config/preset","config/pending","config/on/startup","config/on","config/offset","config/mountingmode","config/mode","config/melody","config/locked","config/lock","config/ledindication","config/interfacemode","config/heatsetpoint","config/group","config/filterlifetime","config/fanmode","config/fadingtime","config/externalwindowopen","config/externalsensortemp","config/enrolled","config/duration","config/displayflipped","config/devicemode","config/devicemode_bis","config/delay","config/ctmin","config/ctmax","config/coolsetpoint","config/controlsequence","config/configured","config/colorcapabilities","config/color/xy/startup_y","config/color/xy/startup_x","config/color/gradient/reversed","config/color/gradient/pixel_count","config/color/execute_if_off","config/color/ct/startup","config/clickmode","config/checkin","config/bri/startup","config/bri/onoff_transitiontime","config/bri/on_level","config/bri/min","config/bri/max","config/bri/execute_if_off","config/battery","config/battery_bis","config/allowtouchlink","config/alert","cap/transition_block","cap/sleeper","cap/on/off_with_effect","cap/measured_value/unit","cap/measured_value/substance","cap/measured_value/quantity","cap/measured_value/min","cap/measured_value/max","cap/groups/not_supported","cap/group","cap/color/xy/red_y","cap/color/xy/red_x","cap/color/xy/green_y","cap/color/xy/green_x","cap/color/xy/blue_y","cap/color/xy/blue_x","cap/color/gradient/styles","cap/color/gradient/pixel_length","cap/color/gradient/pixel_count","cap/color/gradient/max_segments","cap/color/gamut_type","cap/color/effects","cap/color/ct/min","cap/color/ct/max","cap/color/ct/computes_xy","cap/color/capabilities","cap/bri/move_with_onoff","cap/bri/min_dim_level","cap/alert/trigger_effect","attr/uniqueid","attr/type","attr/swversion","attr/swversion_bis","attr/swconfigid","attr/productname","attr/productid","attr/powerup","attr/poweronlevel","attr/poweronct","attr/name","attr/modelid","attr/mode","attr/manufacturername","attr/lastseen","attr/lastannounced","attr/id"],"description":"Item name."}},"required":["name"],"additionalProperties":false}},"example":{}},"required":["type","restapi","uuid","items"],"additionalProperties":false},"description":"Devices section."},"bindings":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"bind":{"type":"string","const":"unicast"},"src.ep":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number","minimum":0,"maximum":255}],"description":"Source endpoint."},"dst.ep":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number","minimum":0,"maximum":255}],"description":"Destination endpoint, generaly 0x01."},"cl":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$","description":"Cluster."},"report":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"},"dt":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},"mf":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"},"min":{"type":"number"},"max":{"type":"number"},"change":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]+$"},{"type":"number"}]}},"required":["at","dt","min","max"],"additionalProperties":false}}},"required":["bind","src.ep","cl"],"additionalProperties":false},{"type":"object","properties":{"bind":{"type":"string","const":"groupcast"},"src.ep":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number","minimum":0,"maximum":255}],"description":"Source endpoint."},"cl":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$","description":"Cluster."},"config.group":{"type":"number","minimum":0,"maximum":255}},"required":["bind","src.ep","cl","config.group"],"additionalProperties":false}]},"description":"Bindings section."}},"required":["schema","manufacturername","modelid","status","subdevices"],"additionalProperties":false},{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"constants1.schema.json"},"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"}},"required":["schema"],"additionalProperties":true},{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"resourceitem1.schema.json"},"id":{"type":"string"},"description":{"type":"string","description":"Item description, better to do not use it."},"comment":{"type":"string","description":"TODO: What is this ? What the difference with description ?"},"deprecated":{"type":"string","pattern":"^(\\d{4})-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:0[1-9])|(?:[12][0-9])|(?:3[01]))$","description":"Date of deprecation, if the item is deprecated, it's better to use the new one."},"datatype":{"type":"string","enum":["String","Bool","Int8","Int16","Int32","Int64","UInt8","UInt16","UInt32","UInt64","Double","Array","Array[3]","ISO 8601 timestamp"],"description":"Data type of the item."},"access":{"type":"string","enum":["R","W","RW"],"description":"Access mode for this item, some of them are not editable."},"public":{"type":"boolean","description":"Item visible on the API."},"implicit":{"type":"boolean","description":"TODO: What is this ?"},"managed":{"type":"boolean","description":"TODO: What is this ?"},"awake":{"type":"boolean","description":"The device is considered awake when this item is set due a incoming command."},"static":{"type":["string","number","boolean"],"description":"A static default value is fixed and can be not changed."},"range":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}],"description":"Values range limit."},"virtual":{"type":"boolean","description":"TODO: What is this ?"},"read":{"anyOf":[{"type":"object","properties":{"fn":{"type":"string","const":"none"}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"fn":{"not":{},"description":"Generic function to read ZCL attributes."}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"tuya","description":"Generic function to read all Tuya datapoints. It has no parameters."}},"required":["fn"],"additionalProperties":false}],"description":"Fonction used to read value."},"parse":{"anyOf":[{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"not":{},"description":"Generic function to read ZCL attributes."},"cppsrc":{"type":"string"}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"ias:zonestatus","description":"Generic function to parse IAS ZONE status change notifications or zone status from read/report command."},"mask":{"anyOf":[{"type":"string","enum":["alarm1","alarm2"]},{"type":"string","const":"alarm1,alarm2"}],"description":"Sets the bitmask for Alert1 and Alert2 item of the IAS Zone status."}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"numtostr","description":"Generic function to to convert number to string."},"srcitem":{"type":"string","enum":["state/y","state/x","state/windowopen","state/water","state/water_bis","state/voltage","state/vibrationstrength","state/vibration","state/valve","state/utc","state/tiltangle","state/tilt","state/test","state/temperature","state/temperature_bis","state/targetdistance","state/tampered","state/speed","state/seconds_remaining","state/sat","state/rotaryevent","state/replacefilter","state/reachable","state/production","state/pressure","state/pressure_bis","state/presenceevent","state/presence","state/power","state/pm2_5","state/panel","state/orientation_z","state/orientation_y","state/orientation_x","state/open","state/open_bis","state/on","state/music_sync","state/mountingmodeactive","state/moisture","state/measured_value","state/lux","state/lowbattery","state/lockstate","state/localtime","state/lightlevel","state/lift","state/lastupdated","state/lastset","state/lastcheckin","state/humidity","state/humidity_bis","state/hue","state/heating","state/gradient","state/gesture","state/fire","state/filterruntime","state/expectedrotation","state/expectedeventduration","state/eventduration","state/errorcode","state/effect","state/deviceruntime","state/daylight","state/dark","state/current_P3","state/current_P2","state/current_P1","state/current","state/ct","state/consumption","state/consumption_2","state/colormode","state/charging","state/carbonmonoxide","state/buttonevent","state/bri","state/battery","state/angle","state/alert","state/alarm","state/airqualityppb","state/airqualityppb_bis","state/airquality","state/airquality_bis","state/action","config/windowopen_set","config/windowcoveringtype","config/volume","config/usertest","config/unoccupiedheatsetpoint","config/tuya_unlock","config/triggerdistance","config/triggerdistance_bis","config/tholdoffset","config/tholddark","config/temperature","config/swingmode","config/speed","config/sensitivitymax","config/sensitivity","config/sensitivity_bis","config/selftest","config/schedule_on","config/schedule","config/reversed","config/resetpresence","config/reportgrid","config/reachable","config/pulseconfiguration","config/preset","config/pending","config/on/startup","config/on","config/offset","config/mountingmode","config/mode","config/melody","config/locked","config/lock","config/ledindication","config/interfacemode","config/heatsetpoint","config/group","config/filterlifetime","config/fanmode","config/fadingtime","config/externalwindowopen","config/externalsensortemp","config/enrolled","config/duration","config/displayflipped","config/devicemode","config/devicemode_bis","config/delay","config/ctmin","config/ctmax","config/coolsetpoint","config/controlsequence","config/configured","config/colorcapabilities","config/color/xy/startup_y","config/color/xy/startup_x","config/color/gradient/reversed","config/color/gradient/pixel_count","config/color/execute_if_off","config/color/ct/startup","config/clickmode","config/checkin","config/bri/startup","config/bri/onoff_transitiontime","config/bri/on_level","config/bri/min","config/bri/max","config/bri/execute_if_off","config/battery","config/battery_bis","config/allowtouchlink","config/alert","cap/transition_block","cap/sleeper","cap/on/off_with_effect","cap/measured_value/unit","cap/measured_value/substance","cap/measured_value/quantity","cap/measured_value/min","cap/measured_value/max","cap/groups/not_supported","cap/group","cap/color/xy/red_y","cap/color/xy/red_x","cap/color/xy/green_y","cap/color/xy/green_x","cap/color/xy/blue_y","cap/color/xy/blue_x","cap/color/gradient/styles","cap/color/gradient/pixel_length","cap/color/gradient/pixel_count","cap/color/gradient/max_segments","cap/color/gamut_type","cap/color/effects","cap/color/ct/min","cap/color/ct/max","cap/color/ct/computes_xy","cap/color/capabilities","cap/bri/move_with_onoff","cap/bri/min_dim_level","cap/alert/trigger_effect","attr/uniqueid","attr/type","attr/swversion","attr/swversion_bis","attr/swconfigid","attr/productname","attr/productid","attr/powerup","attr/poweronlevel","attr/poweronct","attr/name","attr/modelid","attr/mode","attr/manufacturername","attr/lastseen","attr/lastannounced","attr/id"],"description":"The source item holding the number."},"op":{"type":"string","enum":["lt","le","eq","gt","ge"],"description":"Comparison operator (lt | le | eq | gt | ge)"},"to":{"description":"Array of (num, string) mappings"}},"required":["fn","srcitem","op","to"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"time","description":"Specialized function to parse time, local and last set time from read/report commands of the time cluster and auto-sync time if needed."}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"xiaomi:special","description":"Generic function to parse custom Xiaomi attributes and commands."},"idx":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"A 8-bit string hex value."}},"required":["fn","idx"],"additionalProperties":false},{"type":"object","properties":{"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"tuya","description":"Generic function to parse Tuya data."},"dpid":{"type":"number","description":"Data point ID. 1-255 the datapoint ID."}},"required":["fn","dpid"],"additionalProperties":false}],"description":"Fonction used to parse incoming values."},"write":{"anyOf":[{"type":"object","properties":{"fn":{"type":"string","const":"none"}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"not":{},"description":"Generic function to read ZCL attributes."},"cppsrc":{"type":"string"}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"tuya","description":"Generic function to write Tuya data."},"dpid":{"type":"number","description":"Data point ID. 1-255 the datapoint ID."},"dt":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"Data type."}},"required":["fn","dpid","dt"],"additionalProperties":false}],"description":"Fonction used to write value."},"refresh.interval":{"type":"number","description":"Refresh interval used for read fonction, NEED to be superior at value used in binding part."},"values":{"description":"TODO: What is this ?"},"default":{"description":"Defaut value."}},"required":["schema","id"],"additionalProperties":false},{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"subdevice1.schema.json"},"type":{"anyOf":[{"type":"string","enum":["$TYPE_AIR_PURIFIER","$TYPE_AIR_QUALITY_SENSOR","$TYPE_CARBONDIOXIDE_SENSOR","$TYPE_CARBONMONOXIDE_SENSOR","$TYPE_FORMALDEHYDE_SENSOR","$TYPE_PARTICULATEMATTER_SENSOR","$TYPE_ALARM_SENSOR","$TYPE_ANCILLARY_CONTROL","$TYPE_BATTERY_SENSOR","$TYPE_COLOR_LIGHT","$TYPE_COLOR_TEMPERATURE_LIGHT","$TYPE_CONSUMPTION_SENSOR","$TYPE_DIMMABLE_LIGHT","$TYPE_DIMMABLE_PLUGIN_UNIT","$TYPE_DIMMER_SWITCH","$TYPE_DOOR_LOCK","$TYPE_DOOR_LOCK_CONTROLLER","$TYPE_DOOR_LOCK_SENSOR","$TYPE_EXTENDED_COLOR_LIGHT","$TYPE_FIRE_SENSOR","$TYPE_HUMIDITY_SENSOR","$TYPE_LEVEL_CONTROL_SWITCH","$TYPE_LIGHT_LEVEL_SENSOR","$TYPE_MOISTURE_SENSOR","$TYPE_ON_OFF_LIGHT","$TYPE_ON_OFF_LIGHT_SWITCH","$TYPE_ON_OFF_OUTPUT","$TYPE_ON_OFF_PLUGIN_UNIT","$TYPE_ON_OFF_SWITCH","$TYPE_OPEN_CLOSE_SENSOR","$TYPE_POWER_SENSOR","$TYPE_PRESENCE_SENSOR","$TYPE_PRESSURE_SENSOR","$TYPE_RANGE_EXTENDER","$TYPE_RELATIVE_ROTARY","$TYPE_SMART_PLUG","$TYPE_SPECTRAL_SENSOR","$TYPE_SWITCH","$TYPE_TEMPERATURE_SENSOR","$TYPE_THERMOSTAT","$TYPE_TIME","$TYPE_VIBRATION_SENSOR","$TYPE_WARNING_DEVICE","$TYPE_WATER_LEAK_SENSOR","$TYPE_WINDOW_COVERING_DEVICE","$TYPE_ZGP_SWITCH"]},{"type":"string","pattern":"^(?!\\$TYPE_).*"}]},"name":{"type":"string"},"restapi":{"type":"string","enum":["/lights","/sensors"]},"order":{"type":"number"},"uuid":{"anyOf":[{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"string","const":"$address.ext"},{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"}]},{"type":"array","minItems":3,"maxItems":3,"items":[{"type":"string","const":"$address.ext"},{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"}]}]},"items":{"type":"array","items":{"type":"string","enum":["state/y","state/x","state/windowopen","state/water","state/water_bis","state/voltage","state/vibrationstrength","state/vibration","state/valve","state/utc","state/tiltangle","state/tilt","state/test","state/temperature","state/temperature_bis","state/targetdistance","state/tampered","state/speed","state/seconds_remaining","state/sat","state/rotaryevent","state/replacefilter","state/reachable","state/production","state/pressure","state/pressure_bis","state/presenceevent","state/presence","state/power","state/pm2_5","state/panel","state/orientation_z","state/orientation_y","state/orientation_x","state/open","state/open_bis","state/on","state/music_sync","state/mountingmodeactive","state/moisture","state/measured_value","state/lux","state/lowbattery","state/lockstate","state/localtime","state/lightlevel","state/lift","state/lastupdated","state/lastset","state/lastcheckin","state/humidity","state/humidity_bis","state/hue","state/heating","state/gradient","state/gesture","state/fire","state/filterruntime","state/expectedrotation","state/expectedeventduration","state/eventduration","state/errorcode","state/effect","state/deviceruntime","state/daylight","state/dark","state/current_P3","state/current_P2","state/current_P1","state/current","state/ct","state/consumption","state/consumption_2","state/colormode","state/charging","state/carbonmonoxide","state/buttonevent","state/bri","state/battery","state/angle","state/alert","state/alarm","state/airqualityppb","state/airqualityppb_bis","state/airquality","state/airquality_bis","state/action","config/windowopen_set","config/windowcoveringtype","config/volume","config/usertest","config/unoccupiedheatsetpoint","config/tuya_unlock","config/triggerdistance","config/triggerdistance_bis","config/tholdoffset","config/tholddark","config/temperature","config/swingmode","config/speed","config/sensitivitymax","config/sensitivity","config/sensitivity_bis","config/selftest","config/schedule_on","config/schedule","config/reversed","config/resetpresence","config/reportgrid","config/reachable","config/pulseconfiguration","config/preset","config/pending","config/on/startup","config/on","config/offset","config/mountingmode","config/mode","config/melody","config/locked","config/lock","config/ledindication","config/interfacemode","config/heatsetpoint","config/group","config/filterlifetime","config/fanmode","config/fadingtime","config/externalwindowopen","config/externalsensortemp","config/enrolled","config/duration","config/displayflipped","config/devicemode","config/devicemode_bis","config/delay","config/ctmin","config/ctmax","config/coolsetpoint","config/controlsequence","config/configured","config/colorcapabilities","config/color/xy/startup_y","config/color/xy/startup_x","config/color/gradient/reversed","config/color/gradient/pixel_count","config/color/execute_if_off","config/color/ct/startup","config/clickmode","config/checkin","config/bri/startup","config/bri/onoff_transitiontime","config/bri/on_level","config/bri/min","config/bri/max","config/bri/execute_if_off","config/battery","config/battery_bis","config/allowtouchlink","config/alert","cap/transition_block","cap/sleeper","cap/on/off_with_effect","cap/measured_value/unit","cap/measured_value/substance","cap/measured_value/quantity","cap/measured_value/min","cap/measured_value/max","cap/groups/not_supported","cap/group","cap/color/xy/red_y","cap/color/xy/red_x","cap/color/xy/green_y","cap/color/xy/green_x","cap/color/xy/blue_y","cap/color/xy/blue_x","cap/color/gradient/styles","cap/color/gradient/pixel_length","cap/color/gradient/pixel_count","cap/color/gradient/max_segments","cap/color/gamut_type","cap/color/effects","cap/color/ct/min","cap/color/ct/max","cap/color/ct/computes_xy","cap/color/capabilities","cap/bri/move_with_onoff","cap/bri/min_dim_level","cap/alert/trigger_effect","attr/uniqueid","attr/type","attr/swversion","attr/swversion_bis","attr/swconfigid","attr/productname","attr/productid","attr/powerup","attr/poweronlevel","attr/poweronct","attr/name","attr/modelid","attr/mode","attr/manufacturername","attr/lastseen","attr/lastannounced","attr/id"]}},"items_optional":{"$ref":"#/definitions/DDF/anyOf/4/properties/items"}},"required":["schema","type","name","restapi","order","uuid","items"],"additionalProperties":false}]}},"$schema":"http://json-schema.org/draft-07/schema#"}
1
+ {"$ref":"#/definitions/DDF","definitions":{"DDF":{"anyOf":[{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"devcap1.schema.json"},"uuid":{"type":"string"},"ddfvalidate":{"type":"boolean"},"version":{"type":"string"},"version_deconz":{"type":"string"},"doc:path":{"type":"string"},"doc:hdr":{"type":"string"},"md:known_issues":{"type":"array","items":{"type":"string"},"description":"Know issues for this device, markdown file."},"manufacturername":{"anyOf":[{"type":"string","enum":["$MF_AQARA","$MF_BOSCH","$MF_IKEA","$MF_LUMI","$MF_LUTRON","$MF_PHILIPS","$MF_SAMJIN","$MF_SIGNIFY","$MF_TUYA","$MF_XIAOMI"]},{"type":"string","pattern":"^(?!\\$MF_).*"},{"type":"array","items":{"anyOf":[{"type":"string","enum":["$MF_AQARA","$MF_BOSCH","$MF_IKEA","$MF_LUMI","$MF_LUTRON","$MF_PHILIPS","$MF_SAMJIN","$MF_SIGNIFY","$MF_TUYA","$MF_XIAOMI"]},{"type":"string","pattern":"^(?!\\$MF_).*"}]}}],"description":"Manufacturer name from Basic Cluster."},"modelid":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Model ID from Basic Cluster."},"vendor":{"type":"string","description":"Friendly name of the manufacturer."},"comment":{"type":"string"},"matchexpr":{"type":"string","description":"Need to return true for the DDF be used."},"path":{"type":"string","description":"DDF path, useless, can be removed."},"product":{"type":"string","description":"Complements the model id to be shown in the UI."},"sleeper":{"type":"boolean","description":"Sleeping devices can only receive when awake."},"supportsMgmtBind":{"type":"boolean"},"status":{"type":"string","enum":["Draft","Bronze","Silver","Gold"],"description":"The code quality of the DDF file."},"subdevices":{"type":"array","items":{"type":"object","properties":{"type":{"anyOf":[{"type":"string","enum":["$TYPE_AIR_PURIFIER","$TYPE_AIR_QUALITY_SENSOR","$TYPE_CARBONDIOXIDE_SENSOR","$TYPE_CARBONMONOXIDE_SENSOR","$TYPE_FORMALDEHYDE_SENSOR","$TYPE_PARTICULATEMATTER_SENSOR","$TYPE_ALARM_SENSOR","$TYPE_ANCILLARY_CONTROL","$TYPE_BATTERY_SENSOR","$TYPE_COLOR_LIGHT","$TYPE_COLOR_TEMPERATURE_LIGHT","$TYPE_CONSUMPTION_SENSOR","$TYPE_DIMMABLE_LIGHT","$TYPE_DIMMABLE_PLUGIN_UNIT","$TYPE_DIMMER_SWITCH","$TYPE_DOOR_LOCK","$TYPE_DOOR_LOCK_CONTROLLER","$TYPE_DOOR_LOCK_SENSOR","$TYPE_EXTENDED_COLOR_LIGHT","$TYPE_FIRE_SENSOR","$TYPE_HUMIDITY_SENSOR","$TYPE_LEVEL_CONTROL_SWITCH","$TYPE_LIGHT_LEVEL_SENSOR","$TYPE_MOISTURE_SENSOR","$TYPE_ON_OFF_LIGHT","$TYPE_ON_OFF_LIGHT_SWITCH","$TYPE_ON_OFF_OUTPUT","$TYPE_ON_OFF_PLUGIN_UNIT","$TYPE_ON_OFF_SWITCH","$TYPE_OPEN_CLOSE_SENSOR","$TYPE_POWER_SENSOR","$TYPE_PRESENCE_SENSOR","$TYPE_PRESSURE_SENSOR","$TYPE_RANGE_EXTENDER","$TYPE_RELATIVE_ROTARY","$TYPE_SMART_PLUG","$TYPE_SPECTRAL_SENSOR","$TYPE_SWITCH","$TYPE_TEMPERATURE_SENSOR","$TYPE_THERMOSTAT","$TYPE_TIME","$TYPE_VIBRATION_SENSOR","$TYPE_WARNING_DEVICE","$TYPE_WATER_LEAK_SENSOR","$TYPE_WINDOW_COVERING_DEVICE","$TYPE_ZGP_SWITCH"]},{"type":"string","pattern":"^(?!\\$TYPE_).*"}]},"restapi":{"type":"string","enum":["/lights","/sensors"]},"uuid":{"anyOf":[{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"string","const":"$address.ext"},{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"}]},{"type":"array","minItems":3,"maxItems":3,"items":[{"type":"string","const":"$address.ext"},{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"}]}]},"fingerprint":{"type":"object","properties":{"profile":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"},"device":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"},"endpoint":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number","minimum":0,"maximum":255}]},"in":{"type":"array","items":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"}},"out":{"type":"array","items":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"}}},"required":["profile","device","endpoint"],"additionalProperties":false},"meta":{"type":"object","properties":{"values":{},"group.endpoints":{"type":"array","items":{"type":"number"}}},"additionalProperties":false},"buttons":{},"buttonevents":{},"items":{"type":"array","items":{"type":"object","properties":{"ddfvalidate":{"type":"boolean"},"description":{"type":"string","description":"Item description, better to do not use it."},"comment":{"type":"string","description":"TODO: What is this ? What the difference with description ?"},"deprecated":{"type":"string","pattern":"^(\\d{4})-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:0[1-9])|(?:[12][0-9])|(?:3[01]))$","description":"Date of deprecation, if the item is deprecated, it's better to use the new one."},"datatype":{"type":"string","enum":["String","Bool","Int8","Int16","Int32","Int64","UInt8","UInt16","UInt32","UInt64","Double","Array","Array[3]","ISO 8601 timestamp"],"description":"Data type of the item."},"access":{"type":"string","enum":["R","W","RW"],"description":"Access mode for this item, some of them are not editable."},"public":{"type":"boolean","description":"Item visible on the API."},"implicit":{"type":"boolean","description":"TODO: What is this ?"},"managed":{"type":"boolean","description":"TODO: What is this ?"},"awake":{"type":"boolean","description":"The device is considered awake when this item is set due a incoming command."},"static":{"type":["string","number","boolean"],"description":"A static default value is fixed and can be not changed."},"range":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}],"description":"Values range limit."},"virtual":{"type":"boolean","description":"TODO: What is this ?"},"read":{"anyOf":[{"type":"object","properties":{"fn":{"type":"string","const":"none"}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number","minimum":0,"maximum":255}],"description":"Endpoint, 255 means any endpoint, 0 means auto selected from subdevice."},"cl":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$","description":"Cluster ID."},"at":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"},{"type":"array","items":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"}}],"description":"Attribute ID."},"mf":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$","description":"Manufacturer code, must be set to 0x0000 for non manufacturer specific commands."},"cmd":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"Zigbee command."},"eval":{"type":"string","description":"Javascript expression to transform the attribute value to the Item value."},"script":{"type":"string","description":"Relative path of a Javascript .js file."},"fc":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number"}],"description":"Zigbee command frame control."},"fn":{"not":{},"description":"Generic function to read ZCL attributes."}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"tuya","description":"Generic function to read all Tuya datapoints. It has no parameters."}},"required":["fn"],"additionalProperties":false}],"description":"Fonction used to read value."},"parse":{"anyOf":[{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"not":{},"description":"Generic function to read ZCL attributes."},"cppsrc":{"type":"string"}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"ias:zonestatus","description":"Generic function to parse IAS ZONE status change notifications or zone status from read/report command."},"mask":{"anyOf":[{"type":"string","enum":["alarm1","alarm2"]},{"type":"string","const":"alarm1,alarm2"}],"description":"Sets the bitmask for Alert1 and Alert2 item of the IAS Zone status."}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"numtostr","description":"Generic function to to convert number to string."},"srcitem":{"type":"string","enum":["state/y","state/x","state/windowopen","state/water","state/water_bis","state/voltage","state/vibrationstrength","state/vibration","state/valve","state/utc","state/tiltangle","state/tilt","state/test","state/temperature","state/temperature_bis","state/targetdistance","state/tampered","state/speed","state/seconds_remaining","state/sat","state/rotaryevent","state/replacefilter","state/reachable","state/production","state/pressure","state/pressure_bis","state/presenceevent","state/presence","state/power","state/pm2_5","state/panel","state/orientation_z","state/orientation_y","state/orientation_x","state/open","state/open_bis","state/on","state/music_sync","state/mountingmodeactive","state/moisture","state/measured_value","state/lux","state/lowbattery","state/lockstate","state/localtime","state/lightlevel","state/lift","state/lastupdated","state/lastset","state/lastcheckin","state/humidity","state/humidity_bis","state/hue","state/heating","state/gradient","state/gesture","state/fire","state/filterruntime","state/expectedrotation","state/expectedeventduration","state/eventduration","state/errorcode","state/effect","state/deviceruntime","state/daylight","state/dark","state/current_P3","state/current_P2","state/current_P1","state/current","state/ct","state/consumption","state/consumption_2","state/colormode","state/charging","state/carbonmonoxide","state/buttonevent","state/bri","state/battery","state/angle","state/alert","state/alarm","state/airqualityppb","state/airqualityppb_bis","state/airquality","state/airquality_bis","state/action","config/windowopen_set","config/windowcoveringtype","config/volume","config/usertest","config/unoccupiedheatsetpoint","config/tuya_unlock","config/triggerdistance","config/triggerdistance_bis","config/tholdoffset","config/tholddark","config/temperature","config/swingmode","config/speed","config/sensitivitymax","config/sensitivity","config/sensitivity_bis","config/selftest","config/schedule_on","config/schedule","config/reversed","config/resetpresence","config/reportgrid","config/reachable","config/pulseconfiguration","config/preset","config/pending","config/on/startup","config/on","config/offset","config/mountingmode","config/mode","config/melody","config/locked","config/lock","config/ledindication","config/interfacemode","config/heatsetpoint","config/group","config/filterlifetime","config/fanmode","config/fadingtime","config/externalwindowopen","config/externalsensortemp","config/enrolled","config/duration","config/displayflipped","config/devicemode","config/devicemode_bis","config/delay","config/ctmin","config/ctmax","config/coolsetpoint","config/controlsequence","config/configured","config/colorcapabilities","config/color/xy/startup_y","config/color/xy/startup_x","config/color/gradient/reversed","config/color/gradient/pixel_count","config/color/execute_if_off","config/color/ct/startup","config/clickmode","config/checkin","config/bri/startup","config/bri/onoff_transitiontime","config/bri/on_level","config/bri/min","config/bri/max","config/bri/execute_if_off","config/battery","config/battery_bis","config/allowtouchlink","config/alert","cap/transition_block","cap/sleeper","cap/on/off_with_effect","cap/measured_value/unit","cap/measured_value/substance","cap/measured_value/quantity","cap/measured_value/min","cap/measured_value/max","cap/groups/not_supported","cap/group","cap/color/xy/red_y","cap/color/xy/red_x","cap/color/xy/green_y","cap/color/xy/green_x","cap/color/xy/blue_y","cap/color/xy/blue_x","cap/color/gradient/styles","cap/color/gradient/pixel_length","cap/color/gradient/pixel_count","cap/color/gradient/max_segments","cap/color/gamut_type","cap/color/effects","cap/color/ct/min","cap/color/ct/max","cap/color/ct/computes_xy","cap/color/capabilities","cap/bri/move_with_onoff","cap/bri/min_dim_level","cap/alert/trigger_effect","attr/uniqueid","attr/type","attr/swversion","attr/swversion_bis","attr/swconfigid","attr/productname","attr/productid","attr/powerup","attr/poweronlevel","attr/poweronct","attr/name","attr/modelid","attr/mode","attr/manufacturername","attr/lastseen","attr/lastannounced","attr/id"],"description":"The source item holding the number."},"op":{"type":"string","enum":["lt","le","eq","gt","ge"],"description":"Comparison operator (lt | le | eq | gt | ge)"},"to":{"description":"Array of (num, string) mappings"}},"required":["fn","srcitem","op","to"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"time","description":"Specialized function to parse time, local and last set time from read/report commands of the time cluster and auto-sync time if needed."}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"xiaomi:special","description":"Generic function to parse custom Xiaomi attributes and commands."},"idx":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"A 8-bit string hex value."}},"required":["fn","idx"],"additionalProperties":false},{"type":"object","properties":{"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"tuya","description":"Generic function to parse Tuya data."},"dpid":{"type":"number","description":"Data point ID. 1-255 the datapoint ID."}},"required":["fn","dpid"],"additionalProperties":false}],"description":"Fonction used to parse incoming values."},"write":{"anyOf":[{"type":"object","properties":{"fn":{"type":"string","const":"none"}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"type":"number"},"change.timeout":{"type":"number"},"dt":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"Data type."},"fn":{"not":{},"description":"Generic function to read ZCL attributes."},"cppsrc":{"type":"string"}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"tuya","description":"Generic function to write Tuya data."},"dpid":{"type":"number","description":"Data point ID. 1-255 the datapoint ID."},"dt":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"Data type."}},"required":["fn","dpid","dt"],"additionalProperties":false}],"description":"Fonction used to write value."},"refresh.interval":{"type":"number","description":"Refresh interval used for read fonction, NEED to be superior at value used in binding part."},"values":{"description":"TODO: What is this ?"},"default":{"description":"Defaut value."},"name":{"type":"string","enum":["state/y","state/x","state/windowopen","state/water","state/water_bis","state/voltage","state/vibrationstrength","state/vibration","state/valve","state/utc","state/tiltangle","state/tilt","state/test","state/temperature","state/temperature_bis","state/targetdistance","state/tampered","state/speed","state/seconds_remaining","state/sat","state/rotaryevent","state/replacefilter","state/reachable","state/production","state/pressure","state/pressure_bis","state/presenceevent","state/presence","state/power","state/pm2_5","state/panel","state/orientation_z","state/orientation_y","state/orientation_x","state/open","state/open_bis","state/on","state/music_sync","state/mountingmodeactive","state/moisture","state/measured_value","state/lux","state/lowbattery","state/lockstate","state/localtime","state/lightlevel","state/lift","state/lastupdated","state/lastset","state/lastcheckin","state/humidity","state/humidity_bis","state/hue","state/heating","state/gradient","state/gesture","state/fire","state/filterruntime","state/expectedrotation","state/expectedeventduration","state/eventduration","state/errorcode","state/effect","state/deviceruntime","state/daylight","state/dark","state/current_P3","state/current_P2","state/current_P1","state/current","state/ct","state/consumption","state/consumption_2","state/colormode","state/charging","state/carbonmonoxide","state/buttonevent","state/bri","state/battery","state/angle","state/alert","state/alarm","state/airqualityppb","state/airqualityppb_bis","state/airquality","state/airquality_bis","state/action","config/windowopen_set","config/windowcoveringtype","config/volume","config/usertest","config/unoccupiedheatsetpoint","config/tuya_unlock","config/triggerdistance","config/triggerdistance_bis","config/tholdoffset","config/tholddark","config/temperature","config/swingmode","config/speed","config/sensitivitymax","config/sensitivity","config/sensitivity_bis","config/selftest","config/schedule_on","config/schedule","config/reversed","config/resetpresence","config/reportgrid","config/reachable","config/pulseconfiguration","config/preset","config/pending","config/on/startup","config/on","config/offset","config/mountingmode","config/mode","config/melody","config/locked","config/lock","config/ledindication","config/interfacemode","config/heatsetpoint","config/group","config/filterlifetime","config/fanmode","config/fadingtime","config/externalwindowopen","config/externalsensortemp","config/enrolled","config/duration","config/displayflipped","config/devicemode","config/devicemode_bis","config/delay","config/ctmin","config/ctmax","config/coolsetpoint","config/controlsequence","config/configured","config/colorcapabilities","config/color/xy/startup_y","config/color/xy/startup_x","config/color/gradient/reversed","config/color/gradient/pixel_count","config/color/execute_if_off","config/color/ct/startup","config/clickmode","config/checkin","config/bri/startup","config/bri/onoff_transitiontime","config/bri/on_level","config/bri/min","config/bri/max","config/bri/execute_if_off","config/battery","config/battery_bis","config/allowtouchlink","config/alert","cap/transition_block","cap/sleeper","cap/on/off_with_effect","cap/measured_value/unit","cap/measured_value/substance","cap/measured_value/quantity","cap/measured_value/min","cap/measured_value/max","cap/groups/not_supported","cap/group","cap/color/xy/red_y","cap/color/xy/red_x","cap/color/xy/green_y","cap/color/xy/green_x","cap/color/xy/blue_y","cap/color/xy/blue_x","cap/color/gradient/styles","cap/color/gradient/pixel_length","cap/color/gradient/pixel_count","cap/color/gradient/max_segments","cap/color/gamut_type","cap/color/effects","cap/color/ct/min","cap/color/ct/max","cap/color/ct/computes_xy","cap/color/capabilities","cap/bri/move_with_onoff","cap/bri/min_dim_level","cap/alert/trigger_effect","attr/uniqueid","attr/type","attr/swversion","attr/swversion_bis","attr/swconfigid","attr/productname","attr/productid","attr/powerup","attr/poweronlevel","attr/poweronct","attr/name","attr/modelid","attr/mode","attr/manufacturername","attr/lastseen","attr/lastannounced","attr/id"],"description":"Item name."}},"required":["name"],"additionalProperties":false}},"example":{}},"required":["type","restapi","uuid","items"],"additionalProperties":false},"description":"Devices section."},"bindings":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"bind":{"type":"string","const":"unicast"},"src.ep":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number","minimum":0,"maximum":255}],"description":"Source endpoint."},"dst.ep":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number","minimum":0,"maximum":255}],"description":"Destination endpoint, generaly 0x01."},"cl":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$","description":"Cluster."},"report":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"},"dt":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},"mf":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"},"min":{"type":"number"},"max":{"type":"number"},"change":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]+$"},{"type":"number"}]}},"required":["at","dt","min","max"],"additionalProperties":false}}},"required":["bind","src.ep","cl"],"additionalProperties":false},{"type":"object","properties":{"bind":{"type":"string","const":"groupcast"},"src.ep":{"anyOf":[{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"number","minimum":0,"maximum":255}],"description":"Source endpoint."},"cl":{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$","description":"Cluster."},"config.group":{"type":"number","minimum":0,"maximum":255}},"required":["bind","src.ep","cl","config.group"],"additionalProperties":false}]},"description":"Bindings section."}},"required":["schema","manufacturername","modelid","status","subdevices"],"additionalProperties":false},{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"constants1.schema.json"},"ddfvalidate":{"type":"boolean"},"manufacturers":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"pattern":"^\\$MF\\_"}},"device-types":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"pattern":"^\\$TYPE\\_"}}},"required":["schema","manufacturers","device-types"],"additionalProperties":false},{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"constants2.schema.json"},"ddfvalidate":{"type":"boolean"}},"required":["schema"],"additionalProperties":true},{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"resourceitem1.schema.json"},"id":{"type":"string"},"ddfvalidate":{"type":"boolean"},"description":{"type":"string","description":"Item description, better to do not use it."},"comment":{"type":"string","description":"TODO: What is this ? What the difference with description ?"},"deprecated":{"type":"string","pattern":"^(\\d{4})-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:0[1-9])|(?:[12][0-9])|(?:3[01]))$","description":"Date of deprecation, if the item is deprecated, it's better to use the new one."},"datatype":{"type":"string","enum":["String","Bool","Int8","Int16","Int32","Int64","UInt8","UInt16","UInt32","UInt64","Double","Array","Array[3]","ISO 8601 timestamp"],"description":"Data type of the item."},"access":{"type":"string","enum":["R","W","RW"],"description":"Access mode for this item, some of them are not editable."},"public":{"type":"boolean","description":"Item visible on the API."},"implicit":{"type":"boolean","description":"TODO: What is this ?"},"managed":{"type":"boolean","description":"TODO: What is this ?"},"awake":{"type":"boolean","description":"The device is considered awake when this item is set due a incoming command."},"static":{"type":["string","number","boolean"],"description":"A static default value is fixed and can be not changed."},"range":{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"number"},{"type":"number"}],"description":"Values range limit."},"virtual":{"type":"boolean","description":"TODO: What is this ?"},"read":{"anyOf":[{"type":"object","properties":{"fn":{"type":"string","const":"none"}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"fn":{"not":{},"description":"Generic function to read ZCL attributes."}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fc":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/fc"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"tuya","description":"Generic function to read all Tuya datapoints. It has no parameters."}},"required":["fn"],"additionalProperties":false}],"description":"Fonction used to read value."},"parse":{"anyOf":[{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"not":{},"description":"Generic function to read ZCL attributes."},"cppsrc":{"type":"string"}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"ias:zonestatus","description":"Generic function to parse IAS ZONE status change notifications or zone status from read/report command."},"mask":{"anyOf":[{"type":"string","enum":["alarm1","alarm2"]},{"type":"string","const":"alarm1,alarm2"}],"description":"Sets the bitmask for Alert1 and Alert2 item of the IAS Zone status."}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"numtostr","description":"Generic function to to convert number to string."},"srcitem":{"type":"string","enum":["state/y","state/x","state/windowopen","state/water","state/water_bis","state/voltage","state/vibrationstrength","state/vibration","state/valve","state/utc","state/tiltangle","state/tilt","state/test","state/temperature","state/temperature_bis","state/targetdistance","state/tampered","state/speed","state/seconds_remaining","state/sat","state/rotaryevent","state/replacefilter","state/reachable","state/production","state/pressure","state/pressure_bis","state/presenceevent","state/presence","state/power","state/pm2_5","state/panel","state/orientation_z","state/orientation_y","state/orientation_x","state/open","state/open_bis","state/on","state/music_sync","state/mountingmodeactive","state/moisture","state/measured_value","state/lux","state/lowbattery","state/lockstate","state/localtime","state/lightlevel","state/lift","state/lastupdated","state/lastset","state/lastcheckin","state/humidity","state/humidity_bis","state/hue","state/heating","state/gradient","state/gesture","state/fire","state/filterruntime","state/expectedrotation","state/expectedeventduration","state/eventduration","state/errorcode","state/effect","state/deviceruntime","state/daylight","state/dark","state/current_P3","state/current_P2","state/current_P1","state/current","state/ct","state/consumption","state/consumption_2","state/colormode","state/charging","state/carbonmonoxide","state/buttonevent","state/bri","state/battery","state/angle","state/alert","state/alarm","state/airqualityppb","state/airqualityppb_bis","state/airquality","state/airquality_bis","state/action","config/windowopen_set","config/windowcoveringtype","config/volume","config/usertest","config/unoccupiedheatsetpoint","config/tuya_unlock","config/triggerdistance","config/triggerdistance_bis","config/tholdoffset","config/tholddark","config/temperature","config/swingmode","config/speed","config/sensitivitymax","config/sensitivity","config/sensitivity_bis","config/selftest","config/schedule_on","config/schedule","config/reversed","config/resetpresence","config/reportgrid","config/reachable","config/pulseconfiguration","config/preset","config/pending","config/on/startup","config/on","config/offset","config/mountingmode","config/mode","config/melody","config/locked","config/lock","config/ledindication","config/interfacemode","config/heatsetpoint","config/group","config/filterlifetime","config/fanmode","config/fadingtime","config/externalwindowopen","config/externalsensortemp","config/enrolled","config/duration","config/displayflipped","config/devicemode","config/devicemode_bis","config/delay","config/ctmin","config/ctmax","config/coolsetpoint","config/controlsequence","config/configured","config/colorcapabilities","config/color/xy/startup_y","config/color/xy/startup_x","config/color/gradient/reversed","config/color/gradient/pixel_count","config/color/execute_if_off","config/color/ct/startup","config/clickmode","config/checkin","config/bri/startup","config/bri/onoff_transitiontime","config/bri/on_level","config/bri/min","config/bri/max","config/bri/execute_if_off","config/battery","config/battery_bis","config/allowtouchlink","config/alert","cap/transition_block","cap/sleeper","cap/on/off_with_effect","cap/measured_value/unit","cap/measured_value/substance","cap/measured_value/quantity","cap/measured_value/min","cap/measured_value/max","cap/groups/not_supported","cap/group","cap/color/xy/red_y","cap/color/xy/red_x","cap/color/xy/green_y","cap/color/xy/green_x","cap/color/xy/blue_y","cap/color/xy/blue_x","cap/color/gradient/styles","cap/color/gradient/pixel_length","cap/color/gradient/pixel_count","cap/color/gradient/max_segments","cap/color/gamut_type","cap/color/effects","cap/color/ct/min","cap/color/ct/max","cap/color/ct/computes_xy","cap/color/capabilities","cap/bri/move_with_onoff","cap/bri/min_dim_level","cap/alert/trigger_effect","attr/uniqueid","attr/type","attr/swversion","attr/swversion_bis","attr/swconfigid","attr/productname","attr/productid","attr/powerup","attr/poweronlevel","attr/poweronct","attr/name","attr/modelid","attr/mode","attr/manufacturername","attr/lastseen","attr/lastannounced","attr/id"],"description":"The source item holding the number."},"op":{"type":"string","enum":["lt","le","eq","gt","ge"],"description":"Comparison operator (lt | le | eq | gt | ge)"},"to":{"description":"Array of (num, string) mappings"}},"required":["fn","srcitem","op","to"],"additionalProperties":false},{"type":"object","properties":{"fn":{"type":"string","const":"time","description":"Specialized function to parse time, local and last set time from read/report commands of the time cluster and auto-sync time if needed."}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"xiaomi:special","description":"Generic function to parse custom Xiaomi attributes and commands."},"idx":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"A 8-bit string hex value."}},"required":["fn","idx"],"additionalProperties":false},{"type":"object","properties":{"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"tuya","description":"Generic function to parse Tuya data."},"dpid":{"type":"number","description":"Data point ID. 1-255 the datapoint ID."}},"required":["fn","dpid"],"additionalProperties":false}],"description":"Fonction used to parse incoming values."},"write":{"anyOf":[{"type":"object","properties":{"fn":{"type":"string","const":"none"}},"required":["fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"not":{},"description":"Generic function to read ZCL attributes."},"cppsrc":{"type":"string"}},"required":["cl"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"type":"string","const":"zcl:attr","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"ep":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/ep"},"cl":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cl"},"at":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/at"},"mf":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/mf"},"cmd":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/cmd"},"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"state.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/state.timeout"},"change.timeout":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/change.timeout"},"dt":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/write/anyOf/1/properties/dt"},"fn":{"type":"string","const":"zcl:cmd","description":"Generic function to parse ZCL values from read/report commands."}},"required":["cl","fn"],"additionalProperties":false},{"type":"object","properties":{"eval":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/eval"},"script":{"$ref":"#/definitions/DDF/anyOf/0/properties/subdevices/items/properties/items/items/properties/read/anyOf/1/properties/script"},"fn":{"type":"string","const":"tuya","description":"Generic function to write Tuya data."},"dpid":{"type":"number","description":"Data point ID. 1-255 the datapoint ID."},"dt":{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$","description":"Data type."}},"required":["fn","dpid","dt"],"additionalProperties":false}],"description":"Fonction used to write value."},"refresh.interval":{"type":"number","description":"Refresh interval used for read fonction, NEED to be superior at value used in binding part."},"values":{"description":"TODO: What is this ?"},"default":{"description":"Defaut value."}},"required":["schema","id"],"additionalProperties":false},{"type":"object","properties":{"$schema":{"type":"string"},"schema":{"type":"string","const":"subdevice1.schema.json"},"ddfvalidate":{"type":"boolean"},"type":{"anyOf":[{"type":"string","enum":["$TYPE_AIR_PURIFIER","$TYPE_AIR_QUALITY_SENSOR","$TYPE_CARBONDIOXIDE_SENSOR","$TYPE_CARBONMONOXIDE_SENSOR","$TYPE_FORMALDEHYDE_SENSOR","$TYPE_PARTICULATEMATTER_SENSOR","$TYPE_ALARM_SENSOR","$TYPE_ANCILLARY_CONTROL","$TYPE_BATTERY_SENSOR","$TYPE_COLOR_LIGHT","$TYPE_COLOR_TEMPERATURE_LIGHT","$TYPE_CONSUMPTION_SENSOR","$TYPE_DIMMABLE_LIGHT","$TYPE_DIMMABLE_PLUGIN_UNIT","$TYPE_DIMMER_SWITCH","$TYPE_DOOR_LOCK","$TYPE_DOOR_LOCK_CONTROLLER","$TYPE_DOOR_LOCK_SENSOR","$TYPE_EXTENDED_COLOR_LIGHT","$TYPE_FIRE_SENSOR","$TYPE_HUMIDITY_SENSOR","$TYPE_LEVEL_CONTROL_SWITCH","$TYPE_LIGHT_LEVEL_SENSOR","$TYPE_MOISTURE_SENSOR","$TYPE_ON_OFF_LIGHT","$TYPE_ON_OFF_LIGHT_SWITCH","$TYPE_ON_OFF_OUTPUT","$TYPE_ON_OFF_PLUGIN_UNIT","$TYPE_ON_OFF_SWITCH","$TYPE_OPEN_CLOSE_SENSOR","$TYPE_POWER_SENSOR","$TYPE_PRESENCE_SENSOR","$TYPE_PRESSURE_SENSOR","$TYPE_RANGE_EXTENDER","$TYPE_RELATIVE_ROTARY","$TYPE_SMART_PLUG","$TYPE_SPECTRAL_SENSOR","$TYPE_SWITCH","$TYPE_TEMPERATURE_SENSOR","$TYPE_THERMOSTAT","$TYPE_TIME","$TYPE_VIBRATION_SENSOR","$TYPE_WARNING_DEVICE","$TYPE_WATER_LEAK_SENSOR","$TYPE_WINDOW_COVERING_DEVICE","$TYPE_ZGP_SWITCH"]},{"type":"string","pattern":"^(?!\\$TYPE_).*"}]},"name":{"type":"string"},"restapi":{"type":"string","enum":["/lights","/sensors"]},"order":{"type":"number"},"uuid":{"anyOf":[{"type":"array","minItems":2,"maxItems":2,"items":[{"type":"string","const":"$address.ext"},{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"}]},{"type":"array","minItems":3,"maxItems":3,"items":[{"type":"string","const":"$address.ext"},{"type":"string","pattern":"^0x[0-9a-fA-F]{2}$"},{"type":"string","pattern":"^0x[0-9a-fA-F]{4}$"}]}]},"items":{"type":"array","items":{"type":"string","enum":["state/y","state/x","state/windowopen","state/water","state/water_bis","state/voltage","state/vibrationstrength","state/vibration","state/valve","state/utc","state/tiltangle","state/tilt","state/test","state/temperature","state/temperature_bis","state/targetdistance","state/tampered","state/speed","state/seconds_remaining","state/sat","state/rotaryevent","state/replacefilter","state/reachable","state/production","state/pressure","state/pressure_bis","state/presenceevent","state/presence","state/power","state/pm2_5","state/panel","state/orientation_z","state/orientation_y","state/orientation_x","state/open","state/open_bis","state/on","state/music_sync","state/mountingmodeactive","state/moisture","state/measured_value","state/lux","state/lowbattery","state/lockstate","state/localtime","state/lightlevel","state/lift","state/lastupdated","state/lastset","state/lastcheckin","state/humidity","state/humidity_bis","state/hue","state/heating","state/gradient","state/gesture","state/fire","state/filterruntime","state/expectedrotation","state/expectedeventduration","state/eventduration","state/errorcode","state/effect","state/deviceruntime","state/daylight","state/dark","state/current_P3","state/current_P2","state/current_P1","state/current","state/ct","state/consumption","state/consumption_2","state/colormode","state/charging","state/carbonmonoxide","state/buttonevent","state/bri","state/battery","state/angle","state/alert","state/alarm","state/airqualityppb","state/airqualityppb_bis","state/airquality","state/airquality_bis","state/action","config/windowopen_set","config/windowcoveringtype","config/volume","config/usertest","config/unoccupiedheatsetpoint","config/tuya_unlock","config/triggerdistance","config/triggerdistance_bis","config/tholdoffset","config/tholddark","config/temperature","config/swingmode","config/speed","config/sensitivitymax","config/sensitivity","config/sensitivity_bis","config/selftest","config/schedule_on","config/schedule","config/reversed","config/resetpresence","config/reportgrid","config/reachable","config/pulseconfiguration","config/preset","config/pending","config/on/startup","config/on","config/offset","config/mountingmode","config/mode","config/melody","config/locked","config/lock","config/ledindication","config/interfacemode","config/heatsetpoint","config/group","config/filterlifetime","config/fanmode","config/fadingtime","config/externalwindowopen","config/externalsensortemp","config/enrolled","config/duration","config/displayflipped","config/devicemode","config/devicemode_bis","config/delay","config/ctmin","config/ctmax","config/coolsetpoint","config/controlsequence","config/configured","config/colorcapabilities","config/color/xy/startup_y","config/color/xy/startup_x","config/color/gradient/reversed","config/color/gradient/pixel_count","config/color/execute_if_off","config/color/ct/startup","config/clickmode","config/checkin","config/bri/startup","config/bri/onoff_transitiontime","config/bri/on_level","config/bri/min","config/bri/max","config/bri/execute_if_off","config/battery","config/battery_bis","config/allowtouchlink","config/alert","cap/transition_block","cap/sleeper","cap/on/off_with_effect","cap/measured_value/unit","cap/measured_value/substance","cap/measured_value/quantity","cap/measured_value/min","cap/measured_value/max","cap/groups/not_supported","cap/group","cap/color/xy/red_y","cap/color/xy/red_x","cap/color/xy/green_y","cap/color/xy/green_x","cap/color/xy/blue_y","cap/color/xy/blue_x","cap/color/gradient/styles","cap/color/gradient/pixel_length","cap/color/gradient/pixel_count","cap/color/gradient/max_segments","cap/color/gamut_type","cap/color/effects","cap/color/ct/min","cap/color/ct/max","cap/color/ct/computes_xy","cap/color/capabilities","cap/bri/move_with_onoff","cap/bri/min_dim_level","cap/alert/trigger_effect","attr/uniqueid","attr/type","attr/swversion","attr/swversion_bis","attr/swconfigid","attr/productname","attr/productid","attr/powerup","attr/poweronlevel","attr/poweronct","attr/name","attr/modelid","attr/mode","attr/manufacturername","attr/lastseen","attr/lastannounced","attr/id"]}},"items_optional":{"$ref":"#/definitions/DDF/anyOf/4/properties/items"}},"required":["schema","type","name","restapi","order","uuid","items"],"additionalProperties":false}]}},"$schema":"http://json-schema.org/draft-07/schema#"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),G="2.19.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 z=0;z<p.length;z++){const h=`${o}.${i(a.read.cl)}.${i(p[z])}`;c[h]!==void 0&&a["refresh.interval"]-60<c[h]&&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[h]}) 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 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"),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")}).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(l(2)).describe("Zigbee command."),eval:e.z.optional(A()).describe("Javascript expression to transform the attribute value to the Item value."),script:e.z.optional(C()).describe("Relative path of a Javascript .js file.")}),f={read:y.extend({fc:e.z.optional(l(2).or(e.z.number())).describe("Zigbee command frame control.")}),parse:y.extend({}),write:y.extend({"state.timeout":e.z.optional(e.z.number()),"change.timeout":e.z.optional(e.z.number()),dt:e.z.optional(l(2)).describe("Data type.")})};function k(){return e.z.discriminatedUnion("fn",[e.z.strictObject({fn:e.z.literal("none")}),f.read.extend({fn:e.z.undefined().describe("Generic function to read ZCL attributes.")}),f.read.extend({fn:e.z.literal("zcl:attr").describe("Generic function to parse ZCL values from read/report commands.")}),f.read.extend({fn:e.z.literal("zcl:cmd").describe("Generic function to parse ZCL values from read/report commands.")}),e.z.strictObject({fn:e.z.literal("tuya").describe("Generic function to read all Tuya datapoints. It has no parameters.")})]).refine(t=>!("eval"in t&&"script"in t),{message:"eval and script should not both be present"})}function q(t){return e.z.discriminatedUnion("fn",[f.parse.extend({fn:e.z.undefined().describe("Generic function to read ZCL attributes."),cppsrc:e.z.optional(e.z.string())}),f.parse.extend({fn:e.z.literal("zcl:attr").describe("Generic function to parse ZCL values from read/report commands.")}),f.parse.extend({fn:e.z.literal("zcl:cmd").describe("Generic function to parse ZCL values from read/report commands.")}),e.z.strictObject({fn:e.z.literal("ias:zonestatus").describe("Generic function to parse IAS ZONE status change notifications or zone status from read/report command."),mask:e.z.optional(e.z.enum(["alarm1","alarm2"]).or(e.z.literal("alarm1,alarm2"))).describe("Sets the bitmask for Alert1 and Alert2 item of the IAS Zone status.")}),e.z.strictObject({fn:e.z.literal("numtostr").describe("Generic function to to convert number to string."),srcitem:e.z.enum(t.attributes,{errorMap:(r,u)=>r.code==="invalid_enum_value"?{message:`Invalid enum value. Expected item from generic attributes definition, received '${r.received}'`}:{message:u.defaultError}}).describe("The source item holding the number."),op:e.z.enum(["lt","le","eq","gt","ge"]).describe("Comparison operator (lt | le | eq | gt | ge)"),to:V().describe("Array of (num, string) mappings")}),e.z.strictObject({fn:e.z.literal("time").describe("Specialized function to parse time, local and last set time from read/report commands of the time cluster and auto-sync time if needed.")}),f.parse.pick({ep:!0,at:!0,mf:!0,eval:!0,script:!0}).extend({fn:e.z.literal("xiaomi:special").describe("Generic function to parse custom Xiaomi attributes and commands."),idx:l(2).describe("A 8-bit string hex value.")}),f.parse.pick({eval:!0,script:!0}).extend({fn:e.z.literal("tuya").describe("Generic function to parse Tuya data."),dpid:e.z.number().describe("Data point ID. 1-255 the datapoint ID.")})]).refine(r=>!("eval"in r&&"script"in r),{message:"eval and script should not both be present"})}function H(){return e.z.discriminatedUnion("fn",[e.z.strictObject({fn:e.z.literal("none")}),f.write.extend({fn:e.z.undefined().describe("Generic function to read ZCL attributes."),cppsrc:e.z.optional(e.z.string())}),f.write.extend({fn:e.z.literal("zcl:attr").describe("Generic function to parse ZCL values from read/report commands.")}),f.write.extend({fn:e.z.literal("zcl:cmd").describe("Generic function to parse ZCL values from read/report commands.")}),f.write.pick({eval:!0,script:!0}).extend({fn:e.z.literal("tuya").describe("Generic function to write Tuya data."),dpid:e.z.number().describe("Data point ID. 1-255 the datapoint ID."),dt:l(2).describe("Data type.")})]).refine(t=>!("eval"in t&&"script"in t),{message:"eval and script should not both be present"})}function F(t){return e.z.strictObject({$schema:e.z.optional(e.z.string()),schema:e.z.literal("resourceitem1.schema.json"),id:e.z.string(),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()),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"),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=(z,h)=>{var $,j,E;let x=0,I=Number.POSITIVE_INFINITY,_=z,b=[];for(($=o.onSectionStart)==null||$.call(o,h,z.length);b=[],(j=o.onSectionProgress)==null||j.call(o,h,1,z.length),_.forEach(g=>{var T;(T=o.onSectionProgress)==null||T.call(o,h,x++,z.length);try{h==="generic"?n(g.data):h==="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,h,z.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.20.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 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(l(2)).describe("Zigbee command."),eval:e.z.optional(A()).describe("Javascript expression to transform the attribute value to the Item value."),script:e.z.optional(C()).describe("Relative path of a Javascript .js file.")}),f={read:y.extend({fc:e.z.optional(l(2).or(e.z.number())).describe("Zigbee command frame control.")}),parse:y.extend({}),write:y.extend({"state.timeout":e.z.optional(e.z.number()),"change.timeout":e.z.optional(e.z.number()),dt:e.z.optional(l(2)).describe("Data type.")})};function k(){return e.z.discriminatedUnion("fn",[e.z.strictObject({fn:e.z.literal("none")}),f.read.extend({fn:e.z.undefined().describe("Generic function to read ZCL attributes.")}),f.read.extend({fn:e.z.literal("zcl:attr").describe("Generic function to parse ZCL values from read/report commands.")}),f.read.extend({fn:e.z.literal("zcl:cmd").describe("Generic function to parse ZCL values from read/report commands.")}),e.z.strictObject({fn:e.z.literal("tuya").describe("Generic function to read all Tuya datapoints. It has no parameters.")})]).refine(t=>!("eval"in t&&"script"in t),{message:"eval and script should not both be present"})}function q(t){return e.z.discriminatedUnion("fn",[f.parse.extend({fn:e.z.undefined().describe("Generic function to read ZCL attributes."),cppsrc:e.z.optional(e.z.string())}),f.parse.extend({fn:e.z.literal("zcl:attr").describe("Generic function to parse ZCL values from read/report commands.")}),f.parse.extend({fn:e.z.literal("zcl:cmd").describe("Generic function to parse ZCL values from read/report commands.")}),e.z.strictObject({fn:e.z.literal("ias:zonestatus").describe("Generic function to parse IAS ZONE status change notifications or zone status from read/report command."),mask:e.z.optional(e.z.enum(["alarm1","alarm2"]).or(e.z.literal("alarm1,alarm2"))).describe("Sets the bitmask for Alert1 and Alert2 item of the IAS Zone status.")}),e.z.strictObject({fn:e.z.literal("numtostr").describe("Generic function to to convert number to string."),srcitem:e.z.enum(t.attributes,{errorMap:(r,u)=>r.code==="invalid_enum_value"?{message:`Invalid enum value. Expected item from generic attributes definition, received '${r.received}'`}:{message:u.defaultError}}).describe("The source item holding the number."),op:e.z.enum(["lt","le","eq","gt","ge"]).describe("Comparison operator (lt | le | eq | gt | ge)"),to:V().describe("Array of (num, string) mappings")}),e.z.strictObject({fn:e.z.literal("time").describe("Specialized function to parse time, local and last set time from read/report commands of the time cluster and auto-sync time if needed.")}),f.parse.pick({ep:!0,at:!0,mf:!0,eval:!0,script:!0}).extend({fn:e.z.literal("xiaomi:special").describe("Generic function to parse custom Xiaomi attributes and commands."),idx:l(2).describe("A 8-bit string hex value.")}),f.parse.pick({eval:!0,script:!0}).extend({fn:e.z.literal("tuya").describe("Generic function to parse Tuya data."),dpid:e.z.number().describe("Data point ID. 1-255 the datapoint ID.")})]).refine(r=>!("eval"in r&&"script"in r),{message:"eval and script should not both be present"})}function H(){return e.z.discriminatedUnion("fn",[e.z.strictObject({fn:e.z.literal("none")}),f.write.extend({fn:e.z.undefined().describe("Generic function to read ZCL attributes."),cppsrc:e.z.optional(e.z.string())}),f.write.extend({fn:e.z.literal("zcl:attr").describe("Generic function to parse ZCL values from read/report commands.")}),f.write.extend({fn:e.z.literal("zcl:cmd").describe("Generic function to parse ZCL values from read/report commands.")}),f.write.pick({eval:!0,script:!0}).extend({fn:e.z.literal("tuya").describe("Generic function to write Tuya data."),dpid:e.z.number().describe("Data point ID. 1-255 the datapoint ID."),dt:l(2).describe("Data type.")})]).refine(t=>!("eval"in t&&"script"in t),{message:"eval and script should not both be present"})}function F(t){return e.z.strictObject({$schema:e.z.optional(e.z.string()),schema:e.z.literal("resourceitem1.schema.json"),id:e.z.string(),ddfvalidate:e.z.optional(e.z.boolean()),description:e.z.optional(e.z.string()).describe("Item description, better to do not use it."),comment:e.z.optional(e.z.string()).describe("TODO: What is this ? What the difference with description ?"),deprecated:e.z.optional(U()).describe("Date of deprecation, if the item is deprecated, it's better to use the new one."),datatype:e.z.optional(e.z.enum(["String","Bool","Int8","Int16","Int32","Int64","UInt8","UInt16","UInt32","UInt64","Double","Array","Array[3]","ISO 8601 timestamp"])).describe("Data type of the item."),access:e.z.optional(e.z.enum(["R","W","RW"])).describe("Access mode for this item, some of them are not editable."),public:e.z.optional(e.z.boolean()).describe("Item visible on the API."),implicit:e.z.optional(e.z.boolean()).describe("TODO: What is this ?"),managed:e.z.optional(e.z.boolean()).describe("TODO: What is this ?"),awake:e.z.optional(e.z.boolean()).describe("The device is considered awake when this item is set due a incoming command."),static:e.z.optional(e.z.union([e.z.string(),e.z.number(),e.z.boolean()])).describe("A static default value is fixed and can be not changed."),range:e.z.optional(e.z.tuple([e.z.number(),e.z.number()])).describe("Values range limit."),virtual:e.z.optional(e.z.boolean()).describe("TODO: What is this ?"),read:e.z.optional(k()).describe("Fonction used to read value."),parse:e.z.optional(q(t)).describe("Fonction used to parse incoming values."),write:e.z.optional(H()).describe("Fonction used to write value."),"refresh.interval":e.z.optional(e.z.number()).describe("Refresh interval used for read fonction, NEED to be superior at value used in binding part."),values:e.z.optional(e.z.unknown()).describe("TODO: What is this ?"),default:e.z.optional(e.z.unknown()).describe("Defaut value.")})}function J(t){return e.z.strictObject({$schema:e.z.optional(e.z.string()),schema:e.z.literal("devcap1.schema.json"),uuid:e.z.optional(e.z.string()),ddfvalidate:e.z.optional(e.z.boolean()),version:e.z.optional(e.z.string()),version_deconz:e.z.optional(e.z.string()),"doc:path":e.z.optional(e.z.string()),"doc:hdr":e.z.optional(e.z.string()),"md:known_issues":e.z.optional(e.z.array(e.z.string())).describe("Know issues for this device, markdown file."),manufacturername:e.z.union([e.z.enum(Object.keys(t.manufacturers)),e.z.string().regex(/^(?!\$MF_).*/g,"The manufacturer name start with $MF_ but is not present in constants.json"),e.z.array(e.z.union([e.z.enum(Object.keys(t.manufacturers)),e.z.string().regex(/^(?!\$MF_).*/g,"The manufacturer name start with $MF_ but is not present in constants.json")]))]).describe("Manufacturer name from Basic Cluster."),modelid:e.z.string().or(e.z.array(e.z.string())).describe("Model ID from Basic Cluster."),vendor:e.z.optional(e.z.string()).describe("Friendly name of the manufacturer."),comment:e.z.optional(e.z.string()),matchexpr:e.z.optional(A()).describe("Need to return true for the DDF be used."),path:e.z.optional(C()).describe("DDF path, useless, can be removed."),product:e.z.optional(e.z.string()).describe("Complements the model id to be shown in the UI."),sleeper:e.z.optional(e.z.boolean()).describe("Sleeping devices can only receive when awake."),supportsMgmtBind:e.z.optional(e.z.boolean()),status:e.z.enum(["Draft","Bronze","Silver","Gold"]).describe("The code quality of the DDF file."),subdevices:e.z.array(X(t)).describe("Devices section."),bindings:e.z.optional(e.z.array(Q())).describe("Bindings section.")})}function X(t){return e.z.strictObject({type:e.z.union([e.z.enum(Object.keys(t.deviceTypes),{errorMap:(r,u)=>r.code==="invalid_enum_value"?{message:`Invalid enum value. Expected type from generic attributes definition, received '${r.received}'`}:{message:u.defaultError}}),e.z.string().regex(/^(?!\$TYPE_).*/g,"The type start with $TYPE_ but is not present in constants.json")]),restapi:e.z.enum(["/lights","/sensors"]),uuid:S(),fingerprint:e.z.optional(e.z.strictObject({profile:l(4),device:l(4),endpoint:v(),in:e.z.optional(e.z.array(l(4))),out:e.z.optional(e.z.array(l(4)))})),meta:e.z.optional(e.z.strictObject({values:e.z.any(),"group.endpoints":e.z.optional(e.z.array(e.z.number()))})),buttons:e.z.optional(e.z.any()),buttonevents:e.z.optional(e.z.any()),items:e.z.array(K(t)),example:e.z.optional(e.z.unknown())})}function K(t){return F(t).omit({$schema:!0,schema:!0,id:!0}).extend({name:e.z.enum(t.attributes,{errorMap:(r,u)=>r.code==="invalid_enum_value"?{message:`Invalid enum value. Expected item from generic attributes definition, received '${r.received}'`}:{message:u.defaultError}}).describe("Item name.")})}function Q(t){return e.z.discriminatedUnion("bind",[e.z.strictObject({bind:e.z.literal("unicast"),"src.ep":v().describe("Source endpoint."),"dst.ep":e.z.optional(v()).describe("Destination endpoint, generaly 0x01."),cl:l(4).describe("Cluster."),report:e.z.optional(e.z.array(e.z.strictObject({at:l(4),dt:l(2),mf:e.z.optional(l(4)),min:e.z.number(),max:e.z.number(),change:e.z.optional(l().or(e.z.number()))}).refine(r=>r.min<=r.max,{message:"invalid report time, min should be smaller than max"})))}),e.z.strictObject({bind:e.z.literal("groupcast"),"src.ep":v().describe("Source endpoint."),cl:l(4).describe("Cluster."),"config.group":e.z.number().min(0).max(255)})])}function ee(t){const r=e.z.array(e.z.enum(t.attributes,{errorMap:(u,i)=>u.code==="invalid_enum_value"?{message:`Invalid enum value. Expected item from generic attributes definition, received '${u.received}'`}:{message:i.defaultError}}));return e.z.strictObject({$schema:e.z.optional(e.z.string()),schema:e.z.literal("subdevice1.schema.json"),ddfvalidate:e.z.optional(e.z.boolean()),type:e.z.union([e.z.enum(Object.keys(t.deviceTypes),{errorMap:(u,i)=>u.code==="invalid_enum_value"?{message:`Invalid enum value. Expected type from generic attributes definition, received '${u.received}'`}:{message:i.defaultError}}),e.z.string().regex(/^(?!\$TYPE_).*/g,"The type start with $TYPE_ but is not present in constants.json")]),name:e.z.string(),restapi:e.z.enum(["/lights","/sensors"]),order:e.z.number(),uuid:S(),items:r,items_optional:e.z.optional(r)})}function O(t){return e.z.discriminatedUnion("schema",[J(t),B(),D(),F(t),ee(t)]).superRefine((r,u)=>{switch(r.schema){case"devcap1.schema.json":w[r.schema].map(i=>i(r,u,t));break;case"constants2.schema.json":w[r.schema].map(i=>i(r,u,t));break}})}function te(t={attributes:[],manufacturers:{},deviceTypes:{},resources:{},subDevices:{}}){let r=O(t);const u=()=>{r=O(t)},i=m=>["constants1.schema.json","constants2.schema.json","resourceitem1.schema.json","subdevice1.schema.json"].includes(m),c=m=>m==="devcap1.schema.json",n=m=>{const s=r.parse(m);switch(s.schema){case"constants1.schema.json":t.manufacturers={...t.manufacturers,...s.manufacturers},t.deviceTypes={...t.deviceTypes,...s["device-types"]};break;case"constants2.schema.json":{Object.keys(s).filter(o=>o.startsWith("$MF_")).forEach(o=>{t.manufacturers[o]=s[o]}),Object.keys(s).filter(o=>o.startsWith("$TYPE_")).forEach(o=>{t.deviceTypes[o]=s[o]});break}case"resourceitem1.schema.json":{if(t.attributes.includes(s.id))throw new Error(`Got duplicate resource item with attribute id '${s.id}'.`);const o=s,p=s.id;delete o.$schema,delete o.schema,delete o.id,t.resources[p]=o,t.attributes.push(p);break}case"subdevice1.schema.json":t.subDevices[s.type]=s,t.subDevices[s.name]=s;break;default:throw new Error(`Got invalid generic file, got data with schema '${s.schema}'.`)}return u(),!0},d=m=>r.parse(m);return{generics:t,loadGeneric:n,validate:d,bulkValidate:(m,s,o={})=>{const p=(h,z)=>{var $,j,E;let x=0,I=Number.POSITIVE_INFINITY,_=h,b=[];for(($=o.onSectionStart)==null||$.call(o,z,h.length);b=[],(j=o.onSectionProgress)==null||j.call(o,z,1,h.length),_.forEach(g=>{var T;(T=o.onSectionProgress)==null||T.call(o,z,x++,h.length);try{z==="generic"?n(g.data):z==="ddf"&&d(g.data)}catch(Z){b.push({...g,error:Z})}}),!(b.length===0||b.length>=I);)x-=b.length,_=b,I=b.length;return(E=o.onSectionEnd)==null||E.call(o,z,h.length,b),b};return[...p(m,"generic"),...p(s,"ddf")]},getSchema:()=>r,version:G,isGeneric:i,isDDF:c}}exports.createValidator=te;
@@ -4,6 +4,7 @@ export type DDF = {
4
4
  $schema?: string | undefined;
5
5
  schema: "devcap1.schema.json";
6
6
  uuid?: string | undefined;
7
+ ddfvalidate?: boolean | undefined;
7
8
  version?: string | undefined;
8
9
  version_deconz?: string | undefined;
9
10
  "doc:path"?: string | undefined;
@@ -54,6 +55,7 @@ export type DDF = {
54
55
  buttons?: any | undefined;
55
56
  buttonevents?: any | undefined;
56
57
  items: {
58
+ ddfvalidate?: boolean | undefined;
57
59
  /** Item description, better to do not use it. */
58
60
  description?: string | undefined;
59
61
  /** TODO: What is this ? What the difference with description ? */
@@ -358,6 +360,7 @@ export type DDF = {
358
360
  } | {
359
361
  $schema?: string | undefined;
360
362
  schema: "constants1.schema.json";
363
+ ddfvalidate?: boolean | undefined;
361
364
  manufacturers: {
362
365
  [x: string]: string;
363
366
  };
@@ -367,10 +370,12 @@ export type DDF = {
367
370
  } | {
368
371
  $schema?: string | undefined;
369
372
  schema: "constants2.schema.json";
373
+ ddfvalidate?: boolean | undefined;
370
374
  } | {
371
375
  $schema?: string | undefined;
372
376
  schema: "resourceitem1.schema.json";
373
377
  id: string;
378
+ ddfvalidate?: boolean | undefined;
374
379
  /** Item description, better to do not use it. */
375
380
  description?: string | undefined;
376
381
  /** TODO: What is this ? What the difference with description ? */
@@ -645,6 +650,7 @@ export type DDF = {
645
650
  } | {
646
651
  $schema?: string | undefined;
647
652
  schema: "subdevice1.schema.json";
653
+ ddfvalidate?: boolean | undefined;
648
654
  type: ("$TYPE_AIR_PURIFIER" | "$TYPE_AIR_QUALITY_SENSOR" | "$TYPE_CARBONDIOXIDE_SENSOR" | "$TYPE_CARBONMONOXIDE_SENSOR" | "$TYPE_FORMALDEHYDE_SENSOR" | "$TYPE_PARTICULATEMATTER_SENSOR" | "$TYPE_ALARM_SENSOR" | "$TYPE_ANCILLARY_CONTROL" | "$TYPE_BATTERY_SENSOR" | "$TYPE_COLOR_LIGHT" | "$TYPE_COLOR_TEMPERATURE_LIGHT" | "$TYPE_CONSUMPTION_SENSOR" | "$TYPE_DIMMABLE_LIGHT" | "$TYPE_DIMMABLE_PLUGIN_UNIT" | "$TYPE_DIMMER_SWITCH" | "$TYPE_DOOR_LOCK" | "$TYPE_DOOR_LOCK_CONTROLLER" | "$TYPE_DOOR_LOCK_SENSOR" | "$TYPE_EXTENDED_COLOR_LIGHT" | "$TYPE_FIRE_SENSOR" | "$TYPE_HUMIDITY_SENSOR" | "$TYPE_LEVEL_CONTROL_SWITCH" | "$TYPE_LIGHT_LEVEL_SENSOR" | "$TYPE_MOISTURE_SENSOR" | "$TYPE_ON_OFF_LIGHT" | "$TYPE_ON_OFF_LIGHT_SWITCH" | "$TYPE_ON_OFF_OUTPUT" | "$TYPE_ON_OFF_PLUGIN_UNIT" | "$TYPE_ON_OFF_SWITCH" | "$TYPE_OPEN_CLOSE_SENSOR" | "$TYPE_POWER_SENSOR" | "$TYPE_PRESENCE_SENSOR" | "$TYPE_PRESSURE_SENSOR" | "$TYPE_RANGE_EXTENDER" | "$TYPE_RELATIVE_ROTARY" | "$TYPE_SMART_PLUG" | "$TYPE_SPECTRAL_SENSOR" | "$TYPE_SWITCH" | "$TYPE_TEMPERATURE_SENSOR" | "$TYPE_THERMOSTAT" | "$TYPE_TIME" | "$TYPE_VIBRATION_SENSOR" | "$TYPE_WARNING_DEVICE" | "$TYPE_WATER_LEAK_SENSOR" | "$TYPE_WINDOW_COVERING_DEVICE" | "$TYPE_ZGP_SWITCH") | string;
649
655
  name: string;
650
656
  restapi: "/lights" | "/sensors";
@@ -1,5 +1,5 @@
1
1
  import { z as e } from "zod";
2
- const M = "2.19.0", O = {
2
+ const M = "2.20.0", O = {
3
3
  "devcap1.schema.json": [
4
4
  z,
5
5
  P,
@@ -244,6 +244,7 @@ function B(t) {
244
244
  return e.strictObject({
245
245
  $schema: e.optional(e.string()),
246
246
  schema: e.literal("constants1.schema.json"),
247
+ ddfvalidate: e.optional(e.boolean()),
247
248
  manufacturers: e.record(e.string().startsWith("$MF_"), e.string()),
248
249
  "device-types": e.record(e.string().startsWith("$TYPE_"), e.string())
249
250
  });
@@ -251,7 +252,8 @@ function B(t) {
251
252
  function C(t) {
252
253
  return e.object({
253
254
  $schema: e.optional(e.string()),
254
- schema: e.literal("constants2.schema.json")
255
+ schema: e.literal("constants2.schema.json"),
256
+ ddfvalidate: e.optional(e.boolean())
255
257
  }).passthrough();
256
258
  }
257
259
  function U() {
@@ -416,6 +418,7 @@ function Z(t) {
416
418
  $schema: e.optional(e.string()),
417
419
  schema: e.literal("resourceitem1.schema.json"),
418
420
  id: e.string(),
421
+ ddfvalidate: e.optional(e.boolean()),
419
422
  description: e.optional(e.string()).describe("Item description, better to do not use it."),
420
423
  comment: e.optional(e.string()).describe("TODO: What is this ? What the difference with description ?"),
421
424
  deprecated: e.optional(U()).describe("Date of deprecation, if the item is deprecated, it's better to use the new one."),
@@ -458,6 +461,7 @@ function J(t) {
458
461
  $schema: e.optional(e.string()),
459
462
  schema: e.literal("devcap1.schema.json"),
460
463
  uuid: e.optional(e.string()),
464
+ ddfvalidate: e.optional(e.boolean()),
461
465
  version: e.optional(e.string()),
462
466
  version_deconz: e.optional(e.string()),
463
467
  "doc:path": e.optional(e.string()),
@@ -562,6 +566,7 @@ function ee(t) {
562
566
  return e.strictObject({
563
567
  $schema: e.optional(e.string()),
564
568
  schema: e.literal("subdevice1.schema.json"),
569
+ ddfvalidate: e.optional(e.boolean()),
565
570
  type: e.union([
566
571
  e.enum(Object.keys(t.deviceTypes), {
567
572
  errorMap: (u, i) => u.code === "invalid_enum_value" ? { message: `Invalid enum value. Expected type from generic attributes definition, received '${u.received}'` } : { message: i.defaultError }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deconz-community/ddf-validator",
3
- "version": "2.19.0",
3
+ "version": "2.20.0",
4
4
  "description": "Validating DDF files for deconz",
5
5
  "keywords": [
6
6
  "deconz",