Skip to content

Commit 5eddea6

Browse files
committed
Implement review-suggestion
1 parent e814e3d commit 5eddea6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

plugwise/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def _appl_heater_central_info(
7777
self._heater_id = check_heater_central(xml_2)
7878

7979
if self._heater_id == NONE:
80-
return Munch()
80+
return Munch() # pragma: no cover
8181

8282
# Info for On-Off device
8383
if self._on_off_device:

plugwise/util.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ def check_heater_central(xml: etree.Element) -> str:
9999

100100
heater_central_id = list(hc_list[0].keys())[0]
101101
if hc_count > 1:
102-
for item in hc_list: # pragma: no cover
103-
if next(iter(item.values())):
104-
heater_central_id = next(iter(item)) # pragma: no cover
105-
# Stop when a valid id is found
106-
break # pragma: no cover
102+
for item in hc_list:
103+
hc_id, has_actuators = next(iter(item.items()))
104+
if has_actuators:
105+
heater_central_id = hc_id
106+
break
107107

108108
return heater_central_id
109109

0 commit comments

Comments
 (0)