We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b5b3a6 commit bbeedb2Copy full SHA for bbeedb2
plugwise_usb/nodes/circle.py
@@ -662,7 +662,11 @@ async def _energy_log_records_load_from_cache(self) -> bool:
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
- (timestamp, pulses) = collected_logs[address][slot]
+ bucket = collected_logs.get(address, {})
666
+ if slot not in bucket:
667
+ continue
668
+ (timestamp, pulses) = bucket[slot]
669
+ # Keep only recent entries; prune older-or-equal than cutoff
670
if timestamp <= skip_before:
671
continue
672
self._energy_counters.add_pulse_log(
0 commit comments