Skip to content

Commit a44796f

Browse files
committed
Improve logic
1 parent 8580805 commit a44796f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

plugwise_usb/nodes/helpers/pulses.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,6 @@ def _collect_pulses_from_logs(
259259
return None
260260

261261
timestamp = self._last_log_consumption_timestamp
262-
if from_timestamp > timestamp:
263-
self._hourly_reset = True
264262
else:
265263
if self._last_log_production_timestamp is None:
266264
_LOGGER.debug(
@@ -270,8 +268,9 @@ def _collect_pulses_from_logs(
270268
return None
271269

272270
timestamp = self._last_log_production_timestamp
273-
if from_timestamp > timestamp:
274-
self._hourly_reset = True
271+
272+
if from_timestamp > timestamp and not self._hourly_reset_passed:
273+
self._hourly_reset = True
275274

276275
missing_logs = self._logs_missing(from_timestamp)
277276
if missing_logs is None or missing_logs:

0 commit comments

Comments
 (0)