Skip to content

Commit 702af00

Browse files
committed
Fix typo, improve docstring
1 parent 8378501 commit 702af00

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

plugwise_usb/nodes/circle.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ async def energy_log_update(self, address: int | None) -> bool:
560560
if (
561561
log_timestamp is None
562562
or log_pulses is None
563-
# Don't store an old log record; store am empty record instead
563+
# Don't store an old log record; store an empty record instead
564564
or not self._check_timestamp_is_recent(address, _slot, log_timestamp)
565565
):
566566
self._energy_counters.add_empty_log(response.log_address, _slot)
@@ -587,10 +587,7 @@ async def energy_log_update(self, address: int | None) -> bool:
587587
def _check_timestamp_is_recent(
588588
self, address: int, slot: int, timestamp: datetime
589589
) -> bool:
590-
"""Check if the timestamp of the received log-record is recent.
591-
592-
A timestamp newer than MAX_LOG_HOURS is considered recent.
593-
"""
590+
"""Check if a log record timestamp is within the last MAX_LOG_HOURS hours."""
594591
age_seconds = (
595592
datetime.now(tz=UTC) - timestamp.replace(tzinfo=UTC)
596593
).total_seconds()

0 commit comments

Comments
 (0)