mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Protect hm thread for hangs on events (#4717)
This commit is contained in:
parent
4d35f2805f
commit
b5c2be8ffa
@ -544,19 +544,19 @@ def _hm_event_handler(hass, proxy, device, caller, attribute, value):
|
|||||||
|
|
||||||
# keypress event
|
# keypress event
|
||||||
if attribute in HM_PRESS_EVENTS:
|
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_NAME: hmdevice.NAME,
|
||||||
ATTR_PARAM: attribute,
|
ATTR_PARAM: attribute,
|
||||||
ATTR_CHANNEL: channel
|
ATTR_CHANNEL: channel
|
||||||
})
|
}))
|
||||||
return
|
return
|
||||||
|
|
||||||
# impulse event
|
# impulse event
|
||||||
if attribute in HM_IMPULSE_EVENTS:
|
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_NAME: hmdevice.NAME,
|
||||||
ATTR_CHANNEL: channel
|
ATTR_CHANNEL: channel
|
||||||
})
|
}))
|
||||||
return
|
return
|
||||||
|
|
||||||
_LOGGER.warning("Event is unknown and not forwarded to HA")
|
_LOGGER.warning("Event is unknown and not forwarded to HA")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user