Skip to content

Commit 5f54238

Browse files
committed
energy_history can be < 48 hours
We can no longer assume we have the full 48 hours available when we only collect back todays and yesterdays hours.
1 parent 4f08494 commit 5f54238

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

plugwise_usb/nodes/circle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def request_energy_counters(self, log_address=None, callback=None):
652652
self.mac,
653653
str(log_address),
654654
)
655-
elif len(self._energy_history) > 48:
655+
elif len(self._energy_history) > 24:
656656
# Energy history already collected
657657
if (
658658
log_address == self._last_log_address
@@ -793,7 +793,7 @@ def _response_energy_counters(self, message: CircleEnergyCountersResponse):
793793
# Reset energy collection progress
794794
if (
795795
self._energy_history_collecting
796-
and len(self._energy_history) > 48
796+
and len(self._energy_history) > 24
797797
and self._energy_last_collected_timestamp == _utc_hour_timestamp
798798
):
799799
self._energy_last_rollover_timestamp = self._energy_last_collected_timestamp

0 commit comments

Comments
 (0)