From 4c3c86511be80c6c75a193a9d61d0cf7e2731e61 Mon Sep 17 00:00:00 2001 From: rappenze Date: Thu, 2 Nov 2023 18:07:35 +0100 Subject: [PATCH] Fix fibaro event handling (#103199) --- homeassistant/components/fibaro/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/fibaro/__init__.py b/homeassistant/components/fibaro/__init__.py index cdfa7f6a8649b4..8b41c4f404f6cd 100644 --- a/homeassistant/components/fibaro/__init__.py +++ b/homeassistant/components/fibaro/__init__.py @@ -186,12 +186,13 @@ def _on_state_change(self, state: Any) -> None: resolver = FibaroStateResolver(state) for event in resolver.get_events(): - fibaro_id = event.fibaro_id + # event does not always have a fibaro id, therefore it is + # essential that we first check for relevant event type if ( event.event_type.lower() == "centralsceneevent" - and fibaro_id in self._event_callbacks + and event.fibaro_id in self._event_callbacks ): - for callback in self._event_callbacks[fibaro_id]: + for callback in self._event_callbacks[event.fibaro_id]: callback(event) def register(self, device_id: int, callback: Any) -> None: