Skip to content

Commit

Permalink
avoid lingering timer
Browse files Browse the repository at this point in the history
  • Loading branch information
zxdavb committed Aug 17, 2024
1 parent bbc7b58 commit f84ad79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/ramses_cc/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ def find_new_entities(
await async_add_entities(Platform.CLIMATE, new_zones)
await async_add_entities(Platform.WATER_HEATER, new_dhws)

if new_entities: # FIXME: use DataUpdateCoordinator
async_call_later(self.hass, _CALL_LATER_DELAY, self.async_save_client_state)
if new_entities:
await self.async_save_client_state()

# Trigger state updates of all entities
async_dispatcher_send(self.hass, SIGNAL_UPDATE)
Expand All @@ -346,7 +346,7 @@ async def async_bind_device(self, call: ServiceCall) -> None:
confirm_code=list(call.data["confirm"].keys()),
ratify_cmd=cmd,
) # TODO: will need to re-discover schema
async_call_later(self.hass, 5, self.async_update)
async_call_later(self.hass, _CALL_LATER_DELAY, self.async_update)

async def async_force_update(self, _: ServiceCall) -> None:
"""Handle the force_update service call."""
Expand Down Expand Up @@ -378,4 +378,4 @@ async def async_send_packet(self, call: ServiceCall) -> None:
cmd._repr = None

self.client.send_cmd(cmd)
async_call_later(self.hass, 5, self.async_update)
async_call_later(self.hass, _CALL_LATER_DELAY, self.async_update)

0 comments on commit f84ad79

Please sign in to comment.