Skip to content

Commit 0717b95

Browse files
committed
Revert changes in counter.py
1 parent 806c8d6 commit 0717b95

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

plugwise_usb/nodes/helpers/counter.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -283,17 +283,10 @@ def update(
283283
) -> tuple[float | None, datetime | None]:
284284
"""Get pulse update."""
285285
last_reset = datetime.now(tz=LOCAL_TIMEZONE)
286-
timestamp = self._pulse_collection.hourly_reset_time
287286
if self._energy_id in ENERGY_HOUR_COUNTERS:
288-
if timestamp is not None:
289-
last_reset = timestamp
290-
else:
291-
last_reset = last_reset.replace(minute=0, second=0, microsecond=0)
287+
last_reset = last_reset.replace(minute=0, second=0, microsecond=0)
292288
if self._energy_id in ENERGY_DAY_COUNTERS:
293-
if timestamp is not None:
294-
last_reset = timestamp.replace(hour=0)
295-
else:
296-
last_reset = last_reset.replace(hour=0, minute=0, second=0, microsecond=0)
289+
last_reset = last_reset.replace(hour=0, minute=0, second=0, microsecond=0)
297290

298291
pulses, last_update = pulse_collection.collected_pulses(
299292
last_reset, self._is_consumption

0 commit comments

Comments
 (0)