Skip to content

Commit c3a91cb

Browse files
committed
Retry setting total_addresses
1 parent d900645 commit c3a91cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugwise_usb/nodes/circle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,15 +453,15 @@ async def energy_update(self) -> EnergyStatistics | None: # noqa: PLR0911 PLR09
453453
return None
454454

455455
async def _get_initial_energy_logs(self) -> None:
456-
"""Collect initial energy logs for recent hours up to MAX_LOG_HOURS/2 (or hours elapsed today)."""
456+
"""Collect initial energy logs for up to 10 last log addresses or from the hours elapsed today."""
457457
if self._current_log_address is None:
458458
return
459459

460460
_LOGGER.debug(
461461
"Start collecting today's energy logs for node %s.",
462462
self._mac_in_str,
463463
)
464-
total_addresses = min(int(MAX_LOG_HOURS / 2), datetime.now(tz=UTC).hour + 1)
464+
total_addresses = min(11, datetime.now(tz=UTC).hour + 1)
465465
log_address = self._current_log_address
466466
while total_addresses > 0:
467467
result = await self.energy_log_update(log_address)

0 commit comments

Comments
 (0)