Skip to content

Commit 4fbff51

Browse files
committed
More debugging, fix code
1 parent 1cbe4a5 commit 4fbff51

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugwise/data.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,14 @@ def _detect_low_batteries(self) -> list[str]:
9090
message: str | None = notification.get("message")
9191
warning: str | None = notification.get("warning")
9292
notify = message or warning
93+
LOGGER.debug("HOI result: %s", notify)
9394
if notify is not None and all(x in notify for x in matches) and (mac_addresses := mac_pattern.findall(notify)):
9495
mac_address = mac_addresses[0] # re.findall() outputs a list
9596

96-
if mac_address is not None and message is not None: # only block message-type notifications
97-
self._notifications.pop(msg_id)
97+
if mac_address is not None:
9898
mac_address_list.append(mac_address)
99+
if message is not None: # only block message-type notifications
100+
self._notifications.pop(msg_id)
99101

100102
return mac_address_list
101103

0 commit comments

Comments
 (0)