File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
plugwise_usb/nodes/helpers Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -201,7 +201,9 @@ def collected_pulses(
201201 pulses = self ._pulses_consumption + self ._hourly_reset_pulses
202202 self ._pulsecounter_reset = False
203203 else :
204- pulses = self ._prev_pulses_consumption + delta_cons_pulses
204+ pulses = self ._prev_pulses_consumption + self ._hourly_reset_pulses + delta_cons_pulses
205+ if self ._prev_pulses_consumption == 0 :
206+ pulses = self ._pulses_consumption + self ._hourly_reset_pulses
205207
206208 self ._prev_pulses_consumption = self ._pulses_consumption
207209
@@ -271,7 +273,9 @@ def _collect_pulses_from_logs(
271273
272274 timestamp = self ._last_log_production_timestamp
273275
274- if from_timestamp > timestamp and not self ._hourly_reset_passed and not self ._pulsecounter_reset :
276+ if from_timestamp > timestamp and not self ._hourly_reset_passed and not self ._pulsecounter_reset and (
277+ self ._rollover_consumption or self ._rollover_production
278+ ):
275279 self ._hourly_reset = True
276280
277281 missing_logs = self ._logs_missing (from_timestamp )
You can’t perform that action at this time.
0 commit comments