Fix ZHA regressions caused by "Support async validation of device trigger" (#27401)
* Revert "Support async validation of device trigger (#27333)"
This reverts commit fdf4f398a7
.
* Revert only ZHA changes
* Fix whitespace
* Restore ZHA changes but add check to make sure ZHA is loaded
* Address review comment
* Remove additional check
pull/27655/head
parent
2295b33204
commit
c7bd0fe909
|
@ -25,9 +25,9 @@ async def async_validate_trigger_config(hass, config):
|
|||
"""Validate config."""
|
||||
config = TRIGGER_SCHEMA(config)
|
||||
|
||||
if "zha" in hass.config.components:
|
||||
trigger = (config[CONF_TYPE], config[CONF_SUBTYPE])
|
||||
zha_device = await async_get_zha_device(hass, config[CONF_DEVICE_ID])
|
||||
|
||||
if (
|
||||
zha_device.device_automation_triggers is None
|
||||
or trigger not in zha_device.device_automation_triggers
|
||||
|
|
Loading…
Reference in New Issue