mirror of
https://github.com/home-assistant/core.git
synced 2026-09-26 01:11:51 -04:00
Adjust lg_thinq energy polling schedule to mitigate server load (#182810)
Co-authored-by: YunseonPark-LGE <yunseon.park@lge.com>
This commit is contained in:
co-authored by
YunseonPark-LGE
parent
64976f170b
commit
8358c9c144
@@ -829,9 +829,9 @@ class ThinQEnergySensorEntity(ThinQEntity, SensorEntity):
|
||||
"""Handle added to Hass."""
|
||||
await super().async_added_to_hass()
|
||||
if self.coordinator.update_energy_at_time_of_day is None:
|
||||
# random time 01:00:00 ~ 02:59:00
|
||||
# Random time between 01:00:00 and 05:59:00
|
||||
self.coordinator.update_energy_at_time_of_day = time(
|
||||
hour=random.randint(1, 2), minute=random.randint(0, 59)
|
||||
hour=random.randint(1, 5), minute=random.randint(0, 59)
|
||||
)
|
||||
_LOGGER.debug(
|
||||
"[%s] Set energy update time: %s",
|
||||
|
||||
Reference in New Issue
Block a user