Skip to content

Commit e14e1ef

Browse files
committed
Improve further
1 parent cfdfebb commit e14e1ef

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

plugwise/helper.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -915,27 +915,27 @@ def _get_actuator_functionalities(self, xml: etree, data: DeviceData) -> None:
915915
temp_dict: ActuatorData = {}
916916
functionality = "thermostat_functionality"
917917
if item == "temperature_offset":
918+
functionality = "offset_functionality"
918919
# Don't support temperature_offset for legacy Anna
919920
if self._smile_legacy:
920921
continue
921922

922-
functionality = "offset_functionality"
923-
# Add limits and resolution for temperature_offset,
924-
# not provided by Plugwise
925-
temp_dict["lower_bound"] = -5.0
926-
temp_dict["resolution"] = 0.1
927-
temp_dict["upper_bound"] = 5.0
928-
929923
for key in LIMITS:
930924
locator = (
931925
f'.//actuator_functionalities/{functionality}[type="{item}"]/{key}'
932926
)
933927
if (function := xml.find(locator)) is not None:
934928
if function.text == "nil":
935929
break
930+
931+
if key == "offset":
932+
# Add limits and resolution for temperature_offset,
933+
# not provided by Plugwise in the XML data
934+
temp_dict["lower_bound"] = -5.0
935+
temp_dict["resolution"] = 0.1
936+
temp_dict["upper_bound"] = 5.0
937+
936938
temp_dict[key] = format_measure(function.text, TEMP_CELSIUS) # type: ignore [literal-required]
937-
else:
938-
temp_dict = {}
939939

940940
if temp_dict:
941941
# If domestic_hot_water_setpoint is present as actuator,

0 commit comments

Comments
 (0)