Skip to content

Commit d90083e

Browse files
committed
Add debug-log-message
1 parent 2fd8d42 commit d90083e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

plugwise_usb/nodes/helpers/pulses.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ def add_empty_log(self, address: int, slot: int) -> None:
415415
):
416416
self._last_empty_log_slot = slot
417417
recalculate = True
418+
418419
if recalculate:
419420
self.recalculate_missing_log_addresses()
420421

@@ -941,14 +942,21 @@ def _logs_missing(self, from_timestamp: datetime) -> list[int] | None:
941942
calculated_timestamp = self._logs[first_address][
942943
first_slot
943944
].timestamp - timedelta(minutes=log_interval)
945+
_LOGGER.debug(
946+
"_logs_missing | %s | first_empty_log_address=%s",
947+
self._mac,
948+
self._first_empty_log_address,
949+
)
944950
while from_timestamp < calculated_timestamp:
945951
if (
946952
address == self._first_empty_log_address
947953
and slot == self._first_empty_log_slot
948954
):
949955
break
956+
950957
if address not in missing:
951958
missing.append(address)
959+
952960
calculated_timestamp -= timedelta(minutes=log_interval)
953961
address, slot = calc_log_address(address, slot, -1)
954962

0 commit comments

Comments
 (0)