Skip to content

Commit 501cfad

Browse files
committed
Add MAX_ADDRESSES_COLLECTED constant
1 parent 34481b7 commit 501cfad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugwise_usb/nodes/circle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
DEFAULT_FIRMWARE: Final = datetime(2008, 8, 26, 15, 46, tzinfo=UTC)
7575

7676
MAX_LOG_HOURS = DAY_IN_HOURS
77+
MAX_ADDRESSES_COLLECTED: Final = 11
7778

7879
FuncT = TypeVar("FuncT", bound=Callable[..., Any])
7980
_LOGGER = logging.getLogger(__name__)
@@ -461,7 +462,7 @@ async def _get_initial_energy_logs(self) -> None:
461462
"Start collecting today's energy logs for node %s.",
462463
self._mac_in_str,
463464
)
464-
total_addresses = min(11, datetime.now(tz=UTC).hour + 1)
465+
total_addresses = min(MAX_ADDRESSES_COLLECTED, datetime.now(tz=UTC).hour + 1)
465466
log_address = self._current_log_address
466467
while total_addresses > 0:
467468
result = await self.energy_log_update(log_address)

0 commit comments

Comments
 (0)