mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 04:50:05 +00:00
Correct validation of conditions in scripts and automations (#60890)
* Correct validation of conditions in scripts and automations * Fix test
This commit is contained in:
@@ -270,6 +270,16 @@ async def async_validate_action_config(
|
||||
)
|
||||
|
||||
elif action_type == cv.SCRIPT_ACTION_REPEAT:
|
||||
if CONF_UNTIL in config[CONF_REPEAT]:
|
||||
conditions = await condition.async_validate_conditions_config(
|
||||
hass, config[CONF_REPEAT][CONF_UNTIL]
|
||||
)
|
||||
config[CONF_REPEAT][CONF_UNTIL] = conditions
|
||||
if CONF_WHILE in config[CONF_REPEAT]:
|
||||
conditions = await condition.async_validate_conditions_config(
|
||||
hass, config[CONF_REPEAT][CONF_WHILE]
|
||||
)
|
||||
config[CONF_REPEAT][CONF_WHILE] = conditions
|
||||
config[CONF_REPEAT][CONF_SEQUENCE] = await async_validate_actions_config(
|
||||
hass, config[CONF_REPEAT][CONF_SEQUENCE]
|
||||
)
|
||||
@@ -281,6 +291,10 @@ async def async_validate_action_config(
|
||||
)
|
||||
|
||||
for choose_conf in config[CONF_CHOOSE]:
|
||||
conditions = await condition.async_validate_conditions_config(
|
||||
hass, choose_conf[CONF_CONDITIONS]
|
||||
)
|
||||
choose_conf[CONF_CONDITIONS] = conditions
|
||||
choose_conf[CONF_SEQUENCE] = await async_validate_actions_config(
|
||||
hass, choose_conf[CONF_SEQUENCE]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user