From 91b308b4ad1b9e462ab69b257b8ca343917544c2 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 5 Aug 2023 19:14:18 -1000 Subject: [PATCH] Fix handling HomeKit events when the char is in error state (#97884) --- .../components/homekit_controller/device_trigger.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/homekit_controller/device_trigger.py b/homeassistant/components/homekit_controller/device_trigger.py index 4f44cea34f4..9eab0fbb098 100644 --- a/homeassistant/components/homekit_controller/device_trigger.py +++ b/homeassistant/components/homekit_controller/device_trigger.py @@ -262,14 +262,13 @@ def async_fire_triggers(conn: HKDevice, events: dict[tuple[int, int], dict[str, if not trigger_sources: return for (aid, iid), ev in events.items(): - # If the value is None, we received the event via polling - # and we don't want to trigger on that - if ev["value"] is None: - continue if aid in conn.devices: device_id = conn.devices[aid] if source := trigger_sources.get(device_id): - source.fire(iid, ev) + # If the value is None, we received the event via polling + # and we don't want to trigger on that + if ev.get("value") is not None: + source.fire(iid, ev) async def async_get_triggers(