Skip to content

Commit 47abbfe

Browse files
committed
Add extra guarding for setting _midnight_reset_passed to True
1 parent d1ed252 commit 47abbfe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugwise_usb/nodes/helpers/counter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@ def update(
301301
last_reset = (last_reset - timedelta(days=1)).replace(
302302
hour=0, minute=0, second=0, microsecond=0
303303
)
304-
self._midnight_reset_passed = True
304+
if pulse_collection.pulse_counter_reset:
305+
self._midnight_reset_passed = True
305306
else:
306307
last_reset = last_reset.replace(hour=0, minute=0, second=0, microsecond=0)
307308

0 commit comments

Comments
 (0)