@@ -221,12 +221,13 @@ def _collect_pulses_from_logs(
221221 self ._mac ,
222222 )
223223 return None
224+
225+ timestamp = self ._last_log_consumption_timestamp
224226 if (
225- from_timestamp > self . _last_log_consumption_timestamp
227+ from_timestamp > timestamp
226228 and self ._pulsecounter_reset
227229 ):
228- _LOGGER .debug ("_collect_pulses_from_logs | resetting log_pulses collection" )
229- timestamp = self ._last_log_consumption_timestamp
230+ _LOGGER .debug ("_collect_pulses_from_logs | resetting log_pulses to 0" )
230231 return 0
231232 else :
232233 if self ._last_log_production_timestamp is None :
@@ -235,12 +236,13 @@ def _collect_pulses_from_logs(
235236 self ._mac ,
236237 )
237238 return None
239+
240+ timestamp = self ._last_log_production_timestamp
238241 if (
239- from_timestamp > self . _last_log_production_timestamp
242+ from_timestamp > timestamp
240243 and self ._pulsecounter_reset
241244 ):
242- _LOGGER .debug ("_collect_pulses_from_logs | resetting log_pulses collection" )
243- timestamp = self ._last_log_production_timestamp
245+ _LOGGER .debug ("_collect_pulses_from_logs | resetting log_pulses to 0" )
244246 return 0
245247
246248 missing_logs = self ._logs_missing (from_timestamp )
@@ -262,8 +264,9 @@ def _collect_pulses_from_logs(
262264 log_pulses += slot_item .pulses
263265
264266 _LOGGER .debug (
265- "_collect_pulses_from_logs | log_pulses=%s | from %s to %s" ,
267+ "_collect_pulses_from_logs | log_pulses=%s | is_consumption=%s | from %s to %s" ,
266268 log_pulses ,
269+ is_consumption ,
267270 from_timestamp ,
268271 timestamp ,
269272 )
0 commit comments