mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-06-16 11:28:40 +00:00
Initial Solution
This commit is contained in:
@ -2,12 +2,8 @@
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"items": {
|
||||
"$ref": "#/$defs/items"
|
||||
},
|
||||
"title": { "type": "string" },
|
||||
"items": { "$ref": "#/$defs/items" },
|
||||
"required": ["title", "items"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
@ -15,17 +11,19 @@
|
||||
"toggle": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"entity": {
|
||||
"$ref": "#/$defs/entity"
|
||||
},
|
||||
"name": {
|
||||
"title": "Your familiar name",
|
||||
"type": "string"
|
||||
},
|
||||
"entity": { "$ref": "#/$defs/entity" },
|
||||
"name": { "title": "Your familiar name", "type": "string" },
|
||||
"type": {
|
||||
"title": "Menu item type",
|
||||
"description": "One of 'tap', 'template', 'toggle' or 'group'.",
|
||||
"const": "toggle"
|
||||
},
|
||||
"tap_action": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"confirm": { "$ref": "#/$defs/confirm" }
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": ["entity", "name", "type"],
|
||||
@ -34,39 +32,24 @@
|
||||
"template": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"entity": {
|
||||
"$ref": "#/$defs/entity"
|
||||
},
|
||||
"name": {
|
||||
"title": "Your familiar name",
|
||||
"type": "string"
|
||||
},
|
||||
"content": {
|
||||
"title": "What to display (template)",
|
||||
"type": "string"
|
||||
},
|
||||
"entity": { "$ref": "#/$defs/entity" },
|
||||
"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"
|
||||
},
|
||||
"tap_action": {
|
||||
"$ref": "#/$defs/action"
|
||||
}
|
||||
"tap_action": { "$ref": "#/$defs/tap_action" }
|
||||
},
|
||||
"required": ["name", "entity", "content", "type"],
|
||||
"required": ["name", "content", "type"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"tap": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"entity": {
|
||||
"$ref": "#/$defs/entity"
|
||||
},
|
||||
"name": {
|
||||
"title": "Your familiar name",
|
||||
"type": "string"
|
||||
},
|
||||
"entity": { "$ref": "#/$defs/entity" },
|
||||
"name": { "title": "Your familiar name", "type": "string" },
|
||||
"type": {
|
||||
"title": "Menu item type",
|
||||
"description": "One of 'tap', 'template', 'toggle' or 'group'.",
|
||||
@ -78,61 +61,43 @@
|
||||
"title": "Schema change:",
|
||||
"description": "Use 'tap_action' instead to mirror Home Assistant."
|
||||
},
|
||||
"tap_action": {
|
||||
"$ref": "#/$defs/action"
|
||||
}
|
||||
"tap_action": { "$ref": "#/$defs/tap_action" }
|
||||
},
|
||||
"oneOf": [
|
||||
{
|
||||
"required": ["entity", "name", "type", "service"]
|
||||
},
|
||||
{
|
||||
"required": ["entity", "name", "type", "tap_action"]
|
||||
}
|
||||
{ "required": ["name", "type", "service"] },
|
||||
{ "required": ["name", "type", "tap_action"] }
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"menu": {
|
||||
"group": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"entity": {
|
||||
"$ref": "#/$defs/entity"
|
||||
},
|
||||
"name": {
|
||||
"title": "Your familiar name",
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
"$ref": "#/$defs/entity",
|
||||
"deprecated": true,
|
||||
"title": "Schema change:",
|
||||
"description": "'entity' is no longer necessary and should be removed."
|
||||
},
|
||||
"name": { "title": "Your familiar name", "type": "string" },
|
||||
"title": { "type": "string" },
|
||||
"type": {
|
||||
"title": "Menu item type",
|
||||
"description": "One of 'tap', 'template', 'toggle' or 'group'.",
|
||||
"const": "group"
|
||||
},
|
||||
"items": {
|
||||
"$ref": "#/$defs/items"
|
||||
}
|
||||
"items": { "$ref": "#/$defs/items" }
|
||||
},
|
||||
"required": ["entity", "name", "title", "type", "items"],
|
||||
"required": ["name", "title", "type", "items"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/$defs/toggle"
|
||||
},
|
||||
{
|
||||
"$ref": "#/$defs/template"
|
||||
},
|
||||
{
|
||||
"$ref": "#/$defs/tap"
|
||||
},
|
||||
{
|
||||
"$ref": "#/$defs/menu"
|
||||
}
|
||||
{ "$ref": "#/$defs/toggle" },
|
||||
{ "$ref": "#/$defs/template" },
|
||||
{ "$ref": "#/$defs/tap" },
|
||||
{ "$ref": "#/$defs/group" }
|
||||
]
|
||||
}
|
||||
},
|
||||
@ -141,21 +106,24 @@
|
||||
"type": "string",
|
||||
"pattern": "^[^.]+\\.[^.]+$"
|
||||
},
|
||||
"action": {
|
||||
"tap_action": {
|
||||
"title": "Action",
|
||||
"description": "'confirm' field is optional.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"service": {
|
||||
"$ref": "#/$defs/entity"
|
||||
},
|
||||
"confirm": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Confirm the action before execution as a precaution."
|
||||
"service": { "$ref": "#/$defs/entity" },
|
||||
"confirm": { "$ref": "#/$defs/confirm" },
|
||||
"data": {
|
||||
"type": "object",
|
||||
"description": "The object containing the parameters and their values to be passed to the entity. No schema checking can be done here, you are on your own! On application crash, remove the parameters."
|
||||
}
|
||||
},
|
||||
"required": ["service"]
|
||||
},
|
||||
"confirm": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Confirm the action before execution as a precaution."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user