Skip to content

Commit 64e5b54

Browse files
committed
Fixes
1 parent 7cecb54 commit 64e5b54

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plugwise_usb/nodes/circle.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ async def get_missing_energy_logs(self) -> None:
461461
if (
462462
log_address == self._current_log_address
463463
and self._last_collected_energy_timestamp is not None
464+
and log_interval is not None
464465
and (
465466
datetime.now(tz=UTC) - self._last_collected_energy_timestamp
466467
).total_seconds() // 60 > (factor * log_interval) + 5 # minutes
@@ -472,6 +473,7 @@ async def get_missing_energy_logs(self) -> None:
472473
if (
473474
log_address != self._current_log_address
474475
and self._last_collected_energy_timestamp is not None
476+
and log_interval is not None
475477
and prev_address_timestamp is not None
476478
and (
477479
prev_address_timestamp - self._last_collected_energy_timestamp
@@ -642,7 +644,7 @@ async def _energy_log_records_save_to_cache(self) -> None:
642644
cached_logs += f"-{log.timestamp.hour}-{log.timestamp.minute}"
643645
cached_logs += f"-{log.timestamp.second}:{log.pulses}"
644646

645-
_LOGGER.debu("Saving energy logrecords to cache for %s", self._mac_in_str)
647+
_LOGGER.debug("Saving energy logrecords to cache for %s", self._mac_in_str)
646648
self._set_cache(CACHE_ENERGY_COLLECTION, cached_logs)
647649

648650
async def _energy_log_record_update_state(

0 commit comments

Comments
 (0)