From ad9c3a47cfbb5f45dec0b4af2878eb8f42fdaf92 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Fri, 26 Nov 2021 13:21:11 +0100 Subject: [PATCH] Correct validation of conditions in scripts and automations (#60403) --- homeassistant/helpers/script.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/homeassistant/helpers/script.py b/homeassistant/helpers/script.py index 6a727aefb4d..a0f53a06291 100644 --- a/homeassistant/helpers/script.py +++ b/homeassistant/helpers/script.py @@ -262,11 +262,7 @@ async def async_validate_action_config( config = platform.ACTION_SCHEMA(config) # type: ignore elif action_type == cv.SCRIPT_ACTION_CHECK_CONDITION: - if config[CONF_CONDITION] == "device": - platform = await device_automation.async_get_device_automation_platform( - hass, config[CONF_DOMAIN], "condition" - ) - config = platform.CONDITION_SCHEMA(config) # type: ignore + config = await condition.async_validate_condition_config(hass, config) # type: ignore elif action_type == cv.SCRIPT_ACTION_WAIT_FOR_TRIGGER: config[CONF_WAIT_FOR_TRIGGER] = await async_validate_trigger_config(