Compare commits

...

4 Commits

Author SHA1 Message Date
Joseph Abbey
5bdab41d8b Fix examples lists 2025-10-21 19:10:35 +01:00
Joseph Abbey
85080f5d46 2025-10-21 10:07:43 +01:00
Joseph Abbey
35e0fe26d0 Amendments 2025-10-21 09:05:15 +01:00
Joseph Abbey
427c1834a8 2025-10-21 09:03:49 +01:00

View File

@@ -25,13 +25,6 @@
"$defs": { "$defs": {
"toggle": { "toggle": {
"type": "object", "type": "object",
"examples": [
{
"type": "toggle",
"name": "Example",
"entity": "switch.example"
}
],
"properties": { "properties": {
"entity": { "entity": {
"$ref": "#/$defs/entity" "$ref": "#/$defs/entity"
@@ -177,18 +170,6 @@
}, },
"tap": { "tap": {
"type": "object", "type": "object",
"examples": [
{
"type": "tap",
"name": "Example",
"tap_action": {
"service": "notify.notify",
"data": {
"message": "Example"
}
}
}
],
"properties": { "properties": {
"entity": { "entity": {
"$ref": "#/$defs/entity" "$ref": "#/$defs/entity"
@@ -240,14 +221,6 @@
}, },
"group": { "group": {
"type": "object", "type": "object",
"examples": [
{
"type": "group",
"name": "Example",
"title": "Example",
"items": []
}
],
"properties": { "properties": {
"entity": { "entity": {
"$ref": "#/$defs/entity", "$ref": "#/$defs/entity",
@@ -288,105 +261,6 @@
}, },
"numeric": { "numeric": {
"type": "object", "type": "object",
"examples": [
{
"type": "numeric",
"name": "Example",
"entity": "light.example",
"attribute": "brightness",
"service": "light.turn_on",
"service_attribute": "brightness",
"min": 0,
"max": 255,
"step": 1
},
{
"type": "numeric",
"name": "Example",
"entity": "input_number.example",
"service": "input_number.set_value",
"service_attribute": "value",
"min": 0,
"max": 100,
"step": 1
},
{
"type": "numeric",
"name": "Example",
"entity": "number.example",
"service": "number.set_value",
"service_attribute": "value",
"min": 0,
"max": 100,
"step": 1
},
{
"type": "numeric",
"name": "Example",
"entity": "fan.example",
"attribute": "percentage",
"service": "fan.set_percentage",
"service_attribute": "percentage",
"min": 0,
"max": 100,
"step": 1
},
{
"type": "numeric",
"name": "Example",
"entity": "valve.example",
"attribute": "position",
"service": "valve.set_valve_position",
"service_attribute": "position",
"min": 0,
"max": 100,
"step": 1
},
{
"type": "numeric",
"name": "Example",
"entity": "cover.example",
"attribute": "position",
"service": "cover.set_position",
"service_attribute": "position",
"min": 0,
"max": 100,
"step": 1
},
{
"type": "numeric",
"name": "Example",
"entity": "cover.example",
"attribute": "tilt_position",
"service": "cover.set_tilt_position",
"service_attribute": "tilt_position",
"min": 0,
"max": 100,
"step": 1
},
{
"type": "numeric",
"name": "Example",
"entity": "media_player.example",
"attribute": "volume_level",
"service": "media_player.volume_set",
"service_attribute": "volume_level",
"min": 0,
"max": 1,
"step": 0.01
},
{
"type": "numeric",
"name": "Example",
"entity": "climate.example",
"attribute": "temperature",
"service": "climate.set_temperature",
"service_attribute": "temperature",
"min": 0,
"max": 100,
"step": 1
}
],
"allOf": [ "allOf": [
{ {
"properties": { "properties": {
@@ -411,36 +285,37 @@
}, },
"min": { "min": {
"type": "number", "type": "number",
"title": "Minimum value" "title": "Minimum Value"
}, },
"max": { "max": {
"type": "number", "type": "number",
"title": "Maximum value" "title": "Maximum Value"
}, },
"step": { "step": {
"type": "number", "type": "number",
"title": "Step size" "title": "Step Size"
}, },
"decimals": { "display_format": {
"type": "number", "type": "string",
"title": "Number of decimals to display", "title": "Display Format",
"minimum": 0, "description": "A C-Style format string for displaying the value in the UI. https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html#format-instance_function",
"maximum": 10, "default": "%.1f"
"default": 1
}, },
"entity": { "entity": {
"$ref": "#/$defs/entity" "$ref": "#/$defs/entity"
}, },
"attribute": { "attribute": {
"type": "string", "type": "string",
"title": "Attribute on the entity with the current numeric value. To use the state of the entity, do not specify." "title": "Attribute on the entity",
"description": "Attribute on the entity with the current numeric value. To use the state of the entity, do not specify."
}, },
"service": { "service": {
"$ref": "#/$defs/service" "$ref": "#/$defs/service"
}, },
"service_attribute": { "data_attribute": {
"type": "string", "type": "string",
"title": "Attribute on the service data for the value to set." "title": "Attribute on the service data",
"description": "Attribute on the service data for the value to set."
} }
}, },
"required": [ "required": [
@@ -451,7 +326,7 @@
"step", "step",
"entity", "entity",
"service", "service",
"service_attribute" "data_attribute"
], ],
"additionalProperties": false "additionalProperties": false
}, },
@@ -476,7 +351,7 @@
"service": { "service": {
"const": "light.turn_on" "const": "light.turn_on"
}, },
"service_attribute": { "data_attribute": {
"const": "brightness" "const": "brightness"
}, },
"min": { "min": {
@@ -504,7 +379,7 @@
"service": { "service": {
"const": "input_number.set_value" "const": "input_number.set_value"
}, },
"service_attribute": { "data_attribute": {
"const": "value" "const": "value"
} }
}, },
@@ -530,7 +405,7 @@
"service": { "service": {
"const": "number.set_value" "const": "number.set_value"
}, },
"service_attribute": { "data_attribute": {
"const": "value" "const": "value"
} }
}, },
@@ -556,7 +431,7 @@
"service": { "service": {
"const": "fan.set_percentage" "const": "fan.set_percentage"
}, },
"service_attribute": { "data_attribute": {
"const": "percentage" "const": "percentage"
}, },
"min": { "min": {
@@ -583,7 +458,7 @@
"service": { "service": {
"const": "valve.set_valve_position" "const": "valve.set_valve_position"
}, },
"service_attribute": { "data_attribute": {
"const": "position" "const": "position"
}, },
"min": { "min": {
@@ -610,7 +485,7 @@
"service": { "service": {
"const": "cover.set_position" "const": "cover.set_position"
}, },
"service_attribute": { "data_attribute": {
"const": "position" "const": "position"
}, },
"min": { "min": {
@@ -637,7 +512,7 @@
"service": { "service": {
"const": "cover.set_tilt_position" "const": "cover.set_tilt_position"
}, },
"service_attribute": { "data_attribute": {
"const": "tilt_position" "const": "tilt_position"
}, },
"min": { "min": {
@@ -664,7 +539,7 @@
"service": { "service": {
"const": "media_player.volume_set" "const": "media_player.volume_set"
}, },
"service_attribute": { "data_attribute": {
"const": "volume_level" "const": "volume_level"
}, },
"min": { "min": {
@@ -691,7 +566,7 @@
"service": { "service": {
"const": "climate.set_temperature" "const": "climate.set_temperature"
}, },
"service_attribute": { "data_attribute": {
"const": "temperature" "const": "temperature"
} }
} }
@@ -714,24 +589,210 @@
"items": { "items": {
"type": "array", "type": "array",
"items": { "items": {
"oneOf": [ "examples": [
{ {
"$ref": "#/$defs/toggle" "type": "tap",
"name": "Example",
"tap_action": {
"service": "notify.notify",
"data": {
"message": "Example"
}
}
}, },
{ {
"$ref": "#/$defs/template" "type": "toggle",
"name": "Example",
"entity": "switch.example"
}, },
{ {
"$ref": "#/$defs/tap" "type": "group",
"name": "Example",
"title": "Example",
"items": []
}, },
{ {
"$ref": "#/$defs/info" "type": "numeric",
"name": "Example",
"entity": "light.example",
"attribute": "brightness",
"service": "light.turn_on",
"data_attribute": "brightness",
"min": 0,
"max": 255,
"step": 1
}, },
{ {
"$ref": "#/$defs/group" "type": "numeric",
"name": "Example",
"entity": "input_number.example",
"service": "input_number.set_value",
"data_attribute": "value",
"min": 0,
"max": 100,
"step": 1
}, },
{ {
"$ref": "#/$defs/numeric" "type": "numeric",
"name": "Example",
"entity": "number.example",
"service": "number.set_value",
"data_attribute": "value",
"min": 0,
"max": 100,
"step": 1
},
{
"type": "numeric",
"name": "Example",
"entity": "fan.example",
"attribute": "percentage",
"service": "fan.set_percentage",
"data_attribute": "percentage",
"min": 0,
"max": 100,
"step": 1,
"display_format": "%.0f%%"
},
{
"type": "numeric",
"name": "Example",
"entity": "valve.example",
"attribute": "position",
"service": "valve.set_valve_position",
"data_attribute": "position",
"min": 0,
"max": 100,
"step": 1
},
{
"type": "numeric",
"name": "Example",
"entity": "cover.example",
"attribute": "position",
"service": "cover.set_position",
"data_attribute": "position",
"min": 0,
"max": 100,
"step": 1
},
{
"type": "numeric",
"name": "Example",
"entity": "cover.example",
"attribute": "tilt_position",
"service": "cover.set_tilt_position",
"data_attribute": "tilt_position",
"min": 0,
"max": 100,
"step": 1
},
{
"type": "numeric",
"name": "Example",
"entity": "media_player.example",
"attribute": "volume_level",
"service": "media_player.volume_set",
"data_attribute": "volume_level",
"min": 0,
"max": 1,
"step": 0.01
},
{
"type": "numeric",
"name": "Example",
"entity": "climate.example",
"attribute": "temperature",
"service": "climate.set_temperature",
"data_attribute": "temperature"
}
],
"allOf": [
{
"properties": {
"type": {
"enum": [
"toggle",
"template",
"tap",
"info",
"group",
"numeric"
]
}
}
},
{
"if": {
"properties": {
"type": {
"const": "toggle"
}
}
},
"then": {
"$ref": "#/$defs/toggle"
},
"else": {
"if": {
"properties": {
"type": {
"const": "template"
}
}
},
"then": {
"$ref": "#/$defs/template"
},
"else": {
"if": {
"properties": {
"type": {
"const": "tap"
}
}
},
"then": {
"$ref": "#/$defs/tap"
},
"else": {
"if": {
"properties": {
"type": {
"const": "info"
}
}
},
"then": {
"$ref": "#/$defs/info"
},
"else": {
"if": {
"properties": {
"type": {
"const": "group"
}
}
},
"then": {
"$ref": "#/$defs/group"
},
"else": {
"if": {
"properties": {
"type": {
"const": "numeric"
}
}
},
"then": {
"$ref": "#/$defs/numeric"
}
}
}
}
}
}
} }
] ]
} }