Skip to content

Commit f9583a1

Browse files
committed
Updates according to feedback
1 parent 8f9aa95 commit f9583a1

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

plugwise/smile.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class SmileData(SmileHelper):
5151
"""The Plugwise Smile main class."""
5252

5353
def update_for_cooling(self, devices: dict[str, DeviceData]) -> None:
54-
"""Helper-function for adding/updating various cooling-related values)."""
54+
"""Helper-function for adding/updating various cooling-related values."""
5555
for _, device in devices.items():
5656
# For Anna + cooling, modify cooling_state based on provided info by Plugwise
5757
if self.smile_name == "Anna":
@@ -66,13 +66,12 @@ def update_for_cooling(self, devices: dict[str, DeviceData]) -> None:
6666

6767
if self.anna_cooling_enabled:
6868
sensors = device["sensors"]
69-
if self._sched_setpoints is None:
70-
sensors["setpoint_low"] = sensors["setpoint"]
71-
sensors["setpoint_high"] = float(40)
72-
if self._anna_cooling_active:
73-
sensors["setpoint_low"] = float(0)
74-
sensors["setpoint_high"] = sensors["setpoint"]
75-
else:
69+
sensors["setpoint_low"] = sensors["setpoint"]
70+
sensors["setpoint_high"] = float(40)
71+
if self._anna_cooling_active:
72+
sensors["setpoint_low"] = float(0)
73+
sensors["setpoint_high"] = sensors["setpoint"]
74+
if self._sched_setpoints is not None:
7675
sensors["setpoint_low"] = self._sched_setpoints[0]
7776
sensors["setpoint_high"] = self._sched_setpoints[1]
7877

@@ -142,13 +141,12 @@ def get_all_devices(self) -> None:
142141
self._anna_cooling_present = True
143142
else:
144143
adam_cooling_present = True
145-
# Alternative method for the Anna with Elga
146-
elif search.find(locator_2) is not None:
144+
# Alternative method for the Anna with Elga, or alternative method for the Anna with Loria/Thermastage
145+
elif search.find(locator_2) is not None or (
146+
search.find(locator_3) is not None
147+
and search.find(locator_4) is not None
148+
):
147149
self._anna_cooling_present = True
148-
# Alternative method for the Anna with Loria/Thermastage
149-
elif search.find(locator_3) is not None:
150-
if search.find(locator_4) is not None:
151-
self._anna_cooling_present = True
152150

153151
self._cooling_present = self._anna_cooling_present or adam_cooling_present
154152

0 commit comments

Comments
 (0)