From b5c2be8ffa1dcf4e4bf2f763e7d2cbf6efe50990 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sun, 4 Dec 2016 15:31:24 +0100 Subject: [PATCH] Protect hm thread for hangs on events (#4717) --- homeassistant/components/homematic.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/homematic.py b/homeassistant/components/homematic.py index bf38b12237e..245e6a12cc2 100644 --- a/homeassistant/components/homematic.py +++ b/homeassistant/components/homematic.py @@ -544,19 +544,19 @@ def _hm_event_handler(hass, proxy, device, caller, attribute, value): # keypress event if attribute in HM_PRESS_EVENTS: - hass.bus.fire(EVENT_KEYPRESS, { + hass.add_job(hass.bus.async_fire(EVENT_KEYPRESS, { ATTR_NAME: hmdevice.NAME, ATTR_PARAM: attribute, ATTR_CHANNEL: channel - }) + })) return # impulse event if attribute in HM_IMPULSE_EVENTS: - hass.bus.fire(EVENT_KEYPRESS, { + hass.add_job(hass.bus.async_fire(EVENT_KEYPRESS, { ATTR_NAME: hmdevice.NAME, ATTR_CHANNEL: channel - }) + })) return _LOGGER.warning("Event is unknown and not forwarded to HA")