Make set value template number option required (#131625)

This commit is contained in:
Martin Hjelmare 2024-11-26 19:27:59 +01:00 committed by GitHub
parent dfa7ababfb
commit ccbbcbb264
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 1 deletions

View File

@ -157,7 +157,7 @@ def generate_schema(domain: str, flow_type: str) -> vol.Schema:
type=selector.TextSelectorType.TEXT, multiline=False
)
),
vol.Optional(CONF_SET_VALUE): selector.ActionSelector(),
vol.Required(CONF_SET_VALUE): selector.ActionSelector(),
}
if domain == Platform.SELECT:

View File

@ -273,11 +273,21 @@ async def test_config_flow(
"min": "0",
"max": "100",
"step": "0.1",
"set_value": {
"action": "input_number.set_value",
"target": {"entity_id": "input_number.test"},
"data": {"value": "{{ value }}"},
},
},
{
"min": 0,
"max": 100,
"step": 0.1,
"set_value": {
"action": "input_number.set_value",
"target": {"entity_id": "input_number.test"},
"data": {"value": "{{ value }}"},
},
},
),
(
@ -1263,11 +1273,21 @@ async def test_option_flow_sensor_preview_config_entry_removed(
"min": 0,
"max": 100,
"step": 0.1,
"set_value": {
"action": "input_number.set_value",
"target": {"entity_id": "input_number.test"},
"data": {"value": "{{ value }}"},
},
},
{
"min": 0,
"max": 100,
"step": 0.1,
"set_value": {
"action": "input_number.set_value",
"target": {"entity_id": "input_number.test"},
"data": {"value": "{{ value }}"},
},
},
),
(