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": {
"toggle": {
"type": "object",
"examples": [
{
"type": "toggle",
"name": "Example",
"entity": "switch.example"
}
],
"properties": {
"entity": {
"$ref": "#/$defs/entity"
@@ -177,18 +170,6 @@
},
"tap": {
"type": "object",
"examples": [
{
"type": "tap",
"name": "Example",
"tap_action": {
"service": "notify.notify",
"data": {
"message": "Example"
}
}
}
],
"properties": {
"entity": {
"$ref": "#/$defs/entity"
@@ -240,14 +221,6 @@
},
"group": {
"type": "object",
"examples": [
{
"type": "group",
"name": "Example",
"title": "Example",
"items": []
}
],
"properties": {
"entity": {
"$ref": "#/$defs/entity",
@@ -288,105 +261,6 @@
},
"numeric": {
"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": [
{
"properties": {
@@ -411,36 +285,37 @@
},
"min": {
"type": "number",
"title": "Minimum value"
"title": "Minimum Value"
},
"max": {
"type": "number",
"title": "Maximum value"
"title": "Maximum Value"
},
"step": {
"type": "number",
"title": "Step size"
"title": "Step Size"
},
"decimals": {
"type": "number",
"title": "Number of decimals to display",
"minimum": 0,
"maximum": 10,
"default": 1
"display_format": {
"type": "string",
"title": "Display Format",
"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",
"default": "%.1f"
},
"entity": {
"$ref": "#/$defs/entity"
},
"attribute": {
"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": {
"$ref": "#/$defs/service"
},
"service_attribute": {
"data_attribute": {
"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": [
@@ -451,7 +326,7 @@
"step",
"entity",
"service",
"service_attribute"
"data_attribute"
],
"additionalProperties": false
},
@@ -476,7 +351,7 @@
"service": {
"const": "light.turn_on"
},
"service_attribute": {
"data_attribute": {
"const": "brightness"
},
"min": {
@@ -504,7 +379,7 @@
"service": {
"const": "input_number.set_value"
},
"service_attribute": {
"data_attribute": {
"const": "value"
}
},
@@ -530,7 +405,7 @@
"service": {
"const": "number.set_value"
},
"service_attribute": {
"data_attribute": {
"const": "value"
}
},
@@ -556,7 +431,7 @@
"service": {
"const": "fan.set_percentage"
},
"service_attribute": {
"data_attribute": {
"const": "percentage"
},
"min": {
@@ -583,7 +458,7 @@
"service": {
"const": "valve.set_valve_position"
},
"service_attribute": {
"data_attribute": {
"const": "position"
},
"min": {
@@ -610,7 +485,7 @@
"service": {
"const": "cover.set_position"
},
"service_attribute": {
"data_attribute": {
"const": "position"
},
"min": {
@@ -637,7 +512,7 @@
"service": {
"const": "cover.set_tilt_position"
},
"service_attribute": {
"data_attribute": {
"const": "tilt_position"
},
"min": {
@@ -664,7 +539,7 @@
"service": {
"const": "media_player.volume_set"
},
"service_attribute": {
"data_attribute": {
"const": "volume_level"
},
"min": {
@@ -691,7 +566,7 @@
"service": {
"const": "climate.set_temperature"
},
"service_attribute": {
"data_attribute": {
"const": "temperature"
}
}
@@ -714,25 +589,211 @@
"items": {
"type": "array",
"items": {
"oneOf": [
"examples": [
{
"type": "tap",
"name": "Example",
"tap_action": {
"service": "notify.notify",
"data": {
"message": "Example"
}
}
},
{
"type": "toggle",
"name": "Example",
"entity": "switch.example"
},
{
"type": "group",
"name": "Example",
"title": "Example",
"items": []
},
{
"type": "numeric",
"name": "Example",
"entity": "light.example",
"attribute": "brightness",
"service": "light.turn_on",
"data_attribute": "brightness",
"min": 0,
"max": 255,
"step": 1
},
{
"type": "numeric",
"name": "Example",
"entity": "input_number.example",
"service": "input_number.set_value",
"data_attribute": "value",
"min": 0,
"max": 100,
"step": 1
},
{
"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"
}
}
}
}
}
}
}
]
}
},