We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e9943e6 commit 688014fCopy full SHA for 688014f
plugwise_usb/nodes/circle.py
@@ -8,7 +8,6 @@
8
from datetime import UTC, datetime
9
from functools import wraps
10
import logging
11
-from math import floor
12
from typing import Any, Final, TypeVar, cast
13
14
from ..api import (
@@ -462,7 +461,7 @@ async def _get_initial_energy_logs(self) -> None:
462
461
"Start collecting today's energy logs for node %s.",
463
self._mac_in_str,
464
)
465
- total_addresses = int(floor(datetime.now(tz=UTC).hour / 4) + 1)
+ total_addresses = min(MAX_LOG_HOURS / 2, datetime.now(tz=UTC).hour + 1)
466
log_address = self._current_log_address
467
while total_addresses > 0:
468
result = await self.energy_log_update(log_address)
0 commit comments