Skip to content

Commit

Permalink
Add guard to ZHA device triggers (home-assistant#32559)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmulcahey authored Mar 7, 2020
1 parent 1f51038 commit 7324577
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions homeassistant/components/zha/device_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 7324577

Please sign in to comment.