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 28769c0 commit e24a92fCopy full SHA for e24a92f
plugwise_usb/nodes/circle.py
@@ -8,6 +8,7 @@
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 (
@@ -463,7 +464,7 @@ async def _get_initial_energy_logs(self) -> None:
463
464
"Start collecting initial energy logs from the last 10 log addresses for node %s.",
465
self._mac_in_str,
466
)
- total_addresses = 11
467
+ total_addresses = int(floor(datetime.now(tz=UTC).hour / 4) + 1)
468
log_address = self._current_log_address
469
while total_addresses > 0:
470
result = await self.energy_log_update(log_address)
0 commit comments