Skip to content

Commit db088bf

Browse files
committed
Add guarding, as suggested
1 parent f269921 commit db088bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugwise_usb/nodes/circle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ async def get_missing_energy_logs(self) -> None:
450450
log_address = self._current_log_address
451451
while total_addresses > 0:
452452
await self.energy_log_update(log_address)
453-
if (
453+
if self._last_collected_energy_timestamp is not None and (
454454
datetime.now(tz=UTC) - self._last_collected_energy_timestamp
455455
).total_seconds // 60 > 65: # assuming log_interval is 60 minutes
456456
_LOGGER.debug("Energy data collected is outdated, stopping collection")

0 commit comments

Comments
 (0)