We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1dbf8c commit 4950318Copy full SHA for 4950318
plugwise_usb/nodes/circle.py
@@ -661,11 +661,8 @@ async def _energy_log_records_load_from_cache(self) -> bool:
661
662
# Iterate in reverse sorted order directly
663
for address in sorted(collected_logs, reverse=True):
664
- for slot in range(4, 0, -1):
665
- bucket = collected_logs.get(address, {})
666
- if slot not in bucket:
667
- continue
668
- (timestamp, pulses) = bucket[slot]
+ for slot in sorted(collected_logs[address].keys(), reverse=True):
+ (timestamp, pulses) = collected_logs[address][slot]
669
# Keep only recent entries; prune older-or-equal than cutoff
670
if timestamp <= skip_before:
671
continue
0 commit comments