Add guard to ZHA device triggers (#32559)

This commit is contained in:
David F. Mulcahey 2020-03-07 12:59:18 -05:00 committed by GitHub
parent 1f510389b8
commit 732457745f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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])
except (KeyError, AttributeError):
return None
if trigger not in zha_device.device_automation_triggers:
return None
trigger = zha_device.device_automation_triggers[trigger]
event_config = {