Improve validation of device condition config (#27131)
* Improve validation of device condition config * Fix typing
This commit is contained in:
parent
363873dfcb
commit
c43eeee62f
8 changed files with 269 additions and 21 deletions
|
@ -96,7 +96,12 @@ async def async_validate_action_config(
|
|||
platform = await device_automation.async_get_device_automation_platform(
|
||||
hass, config[CONF_DOMAIN], "action"
|
||||
)
|
||||
config = platform.ACTION_SCHEMA(config)
|
||||
config = platform.ACTION_SCHEMA(config) # type: ignore
|
||||
if action_type == ACTION_CHECK_CONDITION and 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
|
||||
|
||||
return config
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue