Skip to content

Commit

Permalink
Update coordinator.py
Browse files Browse the repository at this point in the history
  • Loading branch information
timniklas authored Dec 27, 2024
1 parent b47ccad commit c84660f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/govee_light_ble/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry) -> None:
update_method=self._async_update_data,
# Do not set a polling interval as data will be pushed.
# You can remove this line but left here for explanatory purposes.
update_interval=timedelta(seconds=10)
update_interval=timedelta(seconds=15)
)

async def _async_update_data(self):
Expand All @@ -61,6 +61,10 @@ async def _async_update_data(self):
This is the place to pre-process the data to lookup tables
so entities can quickly look up their data.
"""
if self._api.receiving_in_progress:
#dont connect if update handler is still receiving
_LOGGER.warn("still connected, aborting data update")
return self.data
await self._api.requestStateBuffered()
await self._api.requestBrightnessBuffered()
await self._api.requestColorBuffered()
Expand Down

0 comments on commit c84660f

Please sign in to comment.