Skip to content

Commit 1f956c7

Browse files
committed
Add extra guarding for group_id, remove unneeded guard in check_heater_central()
1 parent 9ea62f3 commit 1f956c7

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

plugwise/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def _get_groups(self) -> None:
208208
if item.get("id") in self.gw_entities:
209209
members.append(item.get("id"))
210210

211-
if group_type in GROUP_TYPES and members:
211+
if group_type in GROUP_TYPES and members and group_id:
212212
self.gw_entities[group_id] = {
213213
"dev_class": group_type,
214214
"model": "Group",

plugwise/util.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,7 @@ def check_heater_central(xml: etree.Element) -> str:
8484
locator = "./appliance[type='heater_central']"
8585
heater_central_count = 0
8686
heater_central_list: list[dict[str, bool]] = []
87-
if not (result := xml.findall(locator)):
88-
return NONE # pragma: no cover
89-
90-
for heater_central in result:
87+
for heater_central in xml.findall(locator):
9188
if (heater_central_id := heater_central.get("id")) is None:
9289
continue # pragma: no cover
9390

0 commit comments

Comments
 (0)