mirror of
https://github.com/home-assistant/core.git
synced 2025-07-11 07:17:12 +00:00
Add guard to ZHA device triggers (#32559)
This commit is contained in:
parent
1f510389b8
commit
732457745f
@ -47,6 +47,10 @@ async def async_attach_trigger(hass, config, action, automation_info):
|
|||||||
zha_device = await async_get_zha_device(hass, config[CONF_DEVICE_ID])
|
zha_device = await async_get_zha_device(hass, config[CONF_DEVICE_ID])
|
||||||
except (KeyError, AttributeError):
|
except (KeyError, AttributeError):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
if trigger not in zha_device.device_automation_triggers:
|
||||||
|
return None
|
||||||
|
|
||||||
trigger = zha_device.device_automation_triggers[trigger]
|
trigger = zha_device.device_automation_triggers[trigger]
|
||||||
|
|
||||||
event_config = {
|
event_config = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user