File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff 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 ()
You can’t perform that action at this time.
0 commit comments