Skip to content

Commit b3cd3a8

Browse files
committed
Don't perform find() twice
1 parent d653eb3 commit b3cd3a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugwise/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ def _get_regulation_mode(self, appliance: etree, data: DeviceData) -> None:
10081008
locator = "./actuator_functionalities/regulation_mode_control_functionality"
10091009
if (search := appliance.find(locator)) is not None:
10101010
data["select_regulation_mode"] = search.find("mode").text
1011-
self._cooling_enabled = search.find("mode").text == "cooling"
1011+
self._cooling_enabled = data["select_regulation_mode"] == "cooling"
10121012

10131013
def _cleanup_data(self, data: DeviceData) -> None:
10141014
"""Helper-function for _get_measurement_data().

0 commit comments

Comments
 (0)