Compare commits

...

3 Commits

Author SHA1 Message Date
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

@@ -295,7 +295,7 @@
"entity": "light.example", "entity": "light.example",
"attribute": "brightness", "attribute": "brightness",
"service": "light.turn_on", "service": "light.turn_on",
"service_attribute": "brightness", "data_attribute": "brightness",
"min": 0, "min": 0,
"max": 255, "max": 255,
"step": 1 "step": 1
@@ -305,7 +305,7 @@
"name": "Example", "name": "Example",
"entity": "input_number.example", "entity": "input_number.example",
"service": "input_number.set_value", "service": "input_number.set_value",
"service_attribute": "value", "data_attribute": "value",
"min": 0, "min": 0,
"max": 100, "max": 100,
"step": 1 "step": 1
@@ -315,7 +315,7 @@
"name": "Example", "name": "Example",
"entity": "number.example", "entity": "number.example",
"service": "number.set_value", "service": "number.set_value",
"service_attribute": "value", "data_attribute": "value",
"min": 0, "min": 0,
"max": 100, "max": 100,
"step": 1 "step": 1
@@ -326,10 +326,11 @@
"entity": "fan.example", "entity": "fan.example",
"attribute": "percentage", "attribute": "percentage",
"service": "fan.set_percentage", "service": "fan.set_percentage",
"service_attribute": "percentage", "data_attribute": "percentage",
"min": 0, "min": 0,
"max": 100, "max": 100,
"step": 1 "step": 1,
"display_format": "%.0f%%"
}, },
{ {
"type": "numeric", "type": "numeric",
@@ -337,7 +338,7 @@
"entity": "valve.example", "entity": "valve.example",
"attribute": "position", "attribute": "position",
"service": "valve.set_valve_position", "service": "valve.set_valve_position",
"service_attribute": "position", "data_attribute": "position",
"min": 0, "min": 0,
"max": 100, "max": 100,
"step": 1 "step": 1
@@ -348,7 +349,7 @@
"entity": "cover.example", "entity": "cover.example",
"attribute": "position", "attribute": "position",
"service": "cover.set_position", "service": "cover.set_position",
"service_attribute": "position", "data_attribute": "position",
"min": 0, "min": 0,
"max": 100, "max": 100,
"step": 1 "step": 1
@@ -359,7 +360,7 @@
"entity": "cover.example", "entity": "cover.example",
"attribute": "tilt_position", "attribute": "tilt_position",
"service": "cover.set_tilt_position", "service": "cover.set_tilt_position",
"service_attribute": "tilt_position", "data_attribute": "tilt_position",
"min": 0, "min": 0,
"max": 100, "max": 100,
"step": 1 "step": 1
@@ -370,7 +371,7 @@
"entity": "media_player.example", "entity": "media_player.example",
"attribute": "volume_level", "attribute": "volume_level",
"service": "media_player.volume_set", "service": "media_player.volume_set",
"service_attribute": "volume_level", "data_attribute": "volume_level",
"min": 0, "min": 0,
"max": 1, "max": 1,
"step": 0.01 "step": 0.01
@@ -381,10 +382,7 @@
"entity": "climate.example", "entity": "climate.example",
"attribute": "temperature", "attribute": "temperature",
"service": "climate.set_temperature", "service": "climate.set_temperature",
"service_attribute": "temperature", "data_attribute": "temperature"
"min": 0,
"max": 100,
"step": 1
} }
], ],
"allOf": [ "allOf": [
@@ -411,36 +409,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 +450,7 @@
"step", "step",
"entity", "entity",
"service", "service",
"service_attribute" "data_attribute"
], ],
"additionalProperties": false "additionalProperties": false
}, },
@@ -476,7 +475,7 @@
"service": { "service": {
"const": "light.turn_on" "const": "light.turn_on"
}, },
"service_attribute": { "data_attribute": {
"const": "brightness" "const": "brightness"
}, },
"min": { "min": {
@@ -504,7 +503,7 @@
"service": { "service": {
"const": "input_number.set_value" "const": "input_number.set_value"
}, },
"service_attribute": { "data_attribute": {
"const": "value" "const": "value"
} }
}, },
@@ -530,7 +529,7 @@
"service": { "service": {
"const": "number.set_value" "const": "number.set_value"
}, },
"service_attribute": { "data_attribute": {
"const": "value" "const": "value"
} }
}, },
@@ -556,7 +555,7 @@
"service": { "service": {
"const": "fan.set_percentage" "const": "fan.set_percentage"
}, },
"service_attribute": { "data_attribute": {
"const": "percentage" "const": "percentage"
}, },
"min": { "min": {
@@ -583,7 +582,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 +609,7 @@
"service": { "service": {
"const": "cover.set_position" "const": "cover.set_position"
}, },
"service_attribute": { "data_attribute": {
"const": "position" "const": "position"
}, },
"min": { "min": {
@@ -637,7 +636,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 +663,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 +690,7 @@
"service": { "service": {
"const": "climate.set_temperature" "const": "climate.set_temperature"
}, },
"service_attribute": { "data_attribute": {
"const": "temperature" "const": "temperature"
} }
} }
@@ -714,24 +713,92 @@
"items": { "items": {
"type": "array", "type": "array",
"items": { "items": {
"oneOf": [ "allOf": [
{ {
"$ref": "#/$defs/toggle" "properties": {
"type": {
"enum": [
"toggle",
"template",
"tap",
"info",
"group",
"numeric"
]
}
}
}, },
{ {
"$ref": "#/$defs/template" "if": {
}, "properties": {
{ "type": {
"$ref": "#/$defs/tap" "const": "toggle"
}, }
{ }
"$ref": "#/$defs/info" },
}, "then": {
{ "$ref": "#/$defs/toggle"
"$ref": "#/$defs/group" },
}, "else": {
{ "if": {
"$ref": "#/$defs/numeric" "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"
}
}
}
}
}
}
} }
] ]
} }