File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
plugwise_usb/nodes/helpers Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,7 @@ def _collect_pulses_from_logs(
213213 _LOGGER .debug ("_collect_pulses_from_logs | %s | self._logs=None" , self ._mac )
214214 return None
215215
216+ timestamp : datetime | None = None
216217 if is_consumption :
217218 if self ._last_log_consumption_timestamp is None :
218219 _LOGGER .debug (
@@ -224,6 +225,8 @@ def _collect_pulses_from_logs(
224225 from_timestamp > self ._last_log_consumption_timestamp
225226 and self ._pulsecounter_reset
226227 ):
228+ _LOGGER .debug ("_collect_pulses_from_logs | resetting log_pulses collection" )
229+ timestamp = self ._last_log_consumption_timestamp
227230 return 0
228231 else :
229232 if self ._last_log_production_timestamp is None :
@@ -236,6 +239,8 @@ def _collect_pulses_from_logs(
236239 from_timestamp > self ._last_log_production_timestamp
237240 and self ._pulsecounter_reset
238241 ):
242+ _LOGGER .debug ("_collect_pulses_from_logs | resetting log_pulses collection" )
243+ timestamp = self ._last_log_production_timestamp
239244 return 0
240245
241246 missing_logs = self ._logs_missing (from_timestamp )
@@ -256,6 +261,12 @@ def _collect_pulses_from_logs(
256261 ):
257262 log_pulses += slot_item .pulses
258263
264+ _LOGGER .debug (
265+ "_collect_pulses_from_logs | log_pulses=%s | from %s to %s" ,
266+ log_pulses ,
267+ from_timestamp ,
268+ timestamp ,
269+ )
259270 return log_pulses
260271
261272 def update_pulse_counter (
You can’t perform that action at this time.
0 commit comments