Skip to content

Commit 8f2b6bf

Browse files
committed
Revert and fix
1 parent cdd15ec commit 8f2b6bf

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

plugwise_usb/nodes/circle.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -417,13 +417,15 @@ def _collect_energy_pulses(self, start_utc: datetime, end_utc: datetime):
417417
str(self._energy_history[_log_timestamp]),
418418
str(_energy_pulses),
419419
)
420-
elif self._energy_history_failed_address.count(_mem_address) == 0:
421-
self._energy_history_failed_address.append(_mem_address)
422-
_LOGGER.info(
423-
"_collect_energy_pulses for %s at %s not found",
424-
self.mac,
425-
str(_log_timestamp),
426-
)
420+
else:
421+
_mem_address = self._energy_timestamp_memory_address(_log_timestamp)
422+
if self._energy_history_failed_address.count(_mem_address) == 0:
423+
self._energy_history_failed_address.append(_mem_address)
424+
_LOGGER.info(
425+
"_collect_energy_pulses for %s at %s not found",
426+
self.mac,
427+
str(_log_timestamp),
428+
)
427429

428430
# Validate all history values where present
429431
if len(self._energy_history_failed_address) == 0:

0 commit comments

Comments
 (0)