Skip to content

Commit fcf9661

Browse files
committed
Avoid creating phantom thermostat-dict
1 parent 8140b3f commit fcf9661

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugwise/helper.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,10 @@ def _get_actuator_functionalities(xml: etree) -> DeviceData:
105105
for key in LIMITS:
106106
locator = f'.//actuator_functionalities/thermostat_functionality[type="{item}"]/{key}'
107107
if (function := xml.find(locator)) is not None:
108-
if function.text != "nil":
109-
temp_dict.update({key: format_measure(function.text, TEMP_CELSIUS)})
108+
if function.text == "nil":
109+
break
110+
111+
temp_dict.update({key: format_measure(function.text, TEMP_CELSIUS)})
110112

111113
if temp_dict:
112114
data[item] = temp_dict # type: ignore [literal-required]

0 commit comments

Comments
 (0)