Fix fibaro event handling (#103199)

This commit is contained in:
rappenze 2023-11-02 18:07:35 +01:00 committed by GitHub
parent 194a799b0a
commit 4c3c86511b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,12 +186,13 @@ class FibaroController:
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: