From cec10bb89a80a4393c91b732079156b38c0488e9 Mon Sep 17 00:00:00 2001 From: Joseph Abbey Date: Fri, 12 Jan 2024 18:43:04 +0000 Subject: [PATCH] Initial schema draft --- config.schema.json | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/config.schema.json b/config.schema.json index 3037b2f..d87334b 100644 --- a/config.schema.json +++ b/config.schema.json @@ -15,13 +15,27 @@ "name": { "title": "Your familiar name", "type": "string" }, "type": { "title": "Menu item type", - "description": "One of 'tap, 'toggle' or 'group'.", + "description": "One of 'tap', 'template', 'toggle' or 'group'.", "const": "toggle" } }, "required": ["entity", "name", "type"], "additionalProperties": false }, + "template": { + "type": "object", + "properties": { + "name": { "title": "Your familiar name", "type": "string" }, + "content": { "title": "What to display (template)", "type": "string" }, + "type": { + "title": "Menu item type", + "description": "One of 'tap', 'template', 'toggle' or 'group'.", + "const": "template" + } + }, + "required": ["name", "content", "type"], + "additionalProperties": false + }, "tap": { "type": "object", "properties": { @@ -29,7 +43,7 @@ "name": { "title": "Your familiar name", "type": "string" }, "type": { "title": "Menu item type", - "description": "One of 'tap, 'toggle' or 'group'.", + "description": "One of 'tap', 'template', 'toggle' or 'group'.", "const": "tap" }, "service": { @@ -54,7 +68,7 @@ "title": { "type": "string" }, "type": { "title": "Menu item type", - "description": "One of 'tap, 'toggle' or 'group'.", + "description": "One of 'tap', 'template', 'toggle' or 'group'.", "const": "group" }, "items": { "$ref": "#/$defs/items" } @@ -66,8 +80,9 @@ "type": "array", "items": { "oneOf": [ - { "$ref": "#/$defs/toggle" }, { "$ref": "#/$defs/tap" }, + { "$ref": "#/$defs/template" }, + { "$ref": "#/$defs/toggle" }, { "$ref": "#/$defs/menu" } ] }