Fix handling HomeKit events when the char is in error state (#97884)

pull/90800/head
J. Nick Koston 2023-08-05 19:14:18 -10:00 committed by GitHub
parent 00e78fbf19
commit 91b308b4ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -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(