Skip to content

Commit

Permalink
Fix fibaro event handling (#103199)
Browse files Browse the repository at this point in the history
  • Loading branch information
rappenze authored Nov 2, 2023
1 parent 194a799 commit 4c3c865
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions homeassistant/components/fibaro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

1 comment on commit 4c3c865

@Poomvst
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I found this problem after updating to this new version. There is a random slight-delay to major-delay from Fibaro to send updated device states to Home Assistant. Please see the attached vdo from the google drive link. However, for Home Assistant to send commands, such as turning on/off the lights, there is no delay. I've never experience this kind of device state update delay problem before (I use this Fibaro and Home Assistant for over a year). Now, all my motion triggers are useless because sometime, it trigger very late in home assistant (by tens seconds). Please help fix the problem. Here is the link to the video.

https://drive.google.com/drive/folders/1EUdrmRc_3PqACEGT7b3gA3FwuJM22Hlr?usp=sharing

Please sign in to comment.