diff --git a/public/config/default-display-config.schema.json b/public/config/default-display-config.schema.json new file mode 100644 index 0000000..5c3a085 --- /dev/null +++ b/public/config/default-display-config.schema.json @@ -0,0 +1,89 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "patternProperties": { + "^_icon$": { + "type": "string" + }, + "^_color$": { + "type": "string" + }, + "^_labelTemplates$": { + "type": "array", + "items": { + "type": "string" + } + }, + "^_states$": { + "$ref": "#/definitions/nestedObjects" + }, + "^[a-zA-Z0-9][a-zA-Z0-9_]+$": { + "type": "object", + "properties": { + "icon": { + "type": "string" + }, + "color": { + "type": "string" + }, + "labelTemplates": { + "type": "array", + "items": { + "type": "string" + } + }, + "states": { + "$ref": "#/definitions/nestedObjects" + }, + "classes": { + "$ref": "#/definitions/nestedObjects" + } + }, + "additionalProperties": false, + "required": [], + "optional": [ + "icon", + "color", + "labelTemplates", + "states", + "classes" + ] + } + }, + "additionalProperties": false, + "definitions": { + "nestedObjects": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9_]+$": { + "type": "object", + "properties": { + "icon": { + "type": "string" + }, + "color": { + "type": "string" + }, + "labelTemplates": { + "type": "array", + "items": { + "type": "string" + } + }, + "states": { + "$ref": "#/definitions/nestedObjects" + } + }, + "additionalProperties": false, + "required": [], + "optional": [ + "icon", + "color", + "labelTemplates", + "states" + ] + } + } + } + } +} diff --git a/public/config/default-display-config.yml b/public/config/default-display-config.yml index 561c5f2..15af1e6 100644 --- a/public/config/default-display-config.yml +++ b/public/config/default-display-config.yml @@ -21,9 +21,8 @@ _color: "#a1a1a1" _labelTemplates: - - - - - - + - "" + - "" - "{{state}}{{unit_of_measurement}}" _states: unavailable: @@ -59,11 +58,13 @@ binary_sensor: plug: icon: mdi:power-plug-off-outline states: - on: mdi:power-plug-outline + on: + icon: mdi:power-plug-outline window: icon: mdi:window-closed-variant states: - on: mdi:window-open-variant + on: + icon: mdi:window-open-variant cover: icon: mdi:garage