Skip to content

Commit a8bfbc0

Browse files
committed
Add counter_reset guarding for log_pulses reset
1 parent d9c2afc commit a8bfbc0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

plugwise_usb/nodes/helpers/pulses.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,10 @@ def _collect_pulses_from_logs(
221221
self._mac,
222222
)
223223
return None
224-
if from_timestamp > self._last_log_consumption_timestamp:
224+
if (
225+
from_timestamp > self._last_log_consumption_timestamp
226+
and self._cons_pulsecounter_reset
227+
):
225228
return 0
226229
else:
227230
if self._last_log_production_timestamp is None:
@@ -230,7 +233,10 @@ def _collect_pulses_from_logs(
230233
self._mac,
231234
)
232235
return None
233-
if from_timestamp > self._last_log_production_timestamp:
236+
if (
237+
from_timestamp > self._last_log_production_timestamp
238+
and self._prod_pulsecounter_reset
239+
):
234240
return 0
235241

236242
missing_logs = self._logs_missing(from_timestamp)

0 commit comments

Comments
 (0)