Skip to content

Commit 8fcd603

Browse files
committed
Formatting, improve log-message
1 parent bfb7cc5 commit 8fcd603

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

plugwise_usb/nodes/helpers/pulses.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,24 +264,27 @@ def update_pulse_counter(
264264
and self._pulses_production < pulses_produced
265265
):
266266
self._rollover_production = True
267+
267268
self._pulses_consumption = pulses_consumed
268269
self._pulses_production = pulses_produced
269270

270271
def _update_rollover(self) -> None:
271272
"""Update rollover states. Returns True if rollover is applicable."""
272273
if self._log_addresses_missing is not None and self._log_addresses_missing:
273274
return
275+
274276
if (
275277
self._pulses_timestamp is None
276278
or self._last_log_consumption_timestamp is None
277279
or self._next_log_consumption_timestamp is None
278280
):
279281
# Unable to determine rollover
280282
return
283+
281284
if self._pulses_timestamp > self._next_log_consumption_timestamp:
282285
self._rollover_consumption = True
283286
_LOGGER.debug(
284-
"_update_rollover | %s | set consumption rollover => pulses newer",
287+
"_update_rollover | %s | consumption rollover to new log_comsumption interval",
285288
self._mac,
286289
)
287290
elif self._pulses_timestamp < self._last_log_consumption_timestamp:
@@ -303,12 +306,14 @@ def _update_rollover(self) -> None:
303306

304307
if not self._log_production:
305308
return
309+
306310
if (
307311
self._last_log_production_timestamp is None
308312
or self._next_log_production_timestamp is None
309313
):
310314
# Unable to determine rollover
311315
return
316+
312317
if self._pulses_timestamp > self._next_log_production_timestamp:
313318
self._rollover_production = True
314319
_LOGGER.debug(

0 commit comments

Comments
 (0)