Skip to content

Commit 0097570

Browse files
committed
_last_known_duration(): add extra guarding
1 parent e77b2d9 commit 0097570

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

plugwise_usb/nodes/helpers/pulses.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,9 @@ def _last_known_duration(self) -> timedelta:
921921
):
922922
address, slot = calc_log_address(address, slot, -1)
923923

924+
if self._logs[address][slot].timestamp == last_known_timestamp:
925+
return timedelta(hours=1)
926+
924927
return self._logs[address][slot].timestamp - last_known_timestamp
925928

926929
def _missing_addresses_before(

0 commit comments

Comments
 (0)