Skip to content

Commit 7c8a5b8

Browse files
committed
Revert double, combine
1 parent 40d9884 commit 7c8a5b8

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

plugwise/helper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ def __init__(self) -> None:
258258
self._on_off_device = False
259259
self._opentherm_device = False
260260
self._outdoor_temp: float
261-
self._presets_list: list[str] = []
262261
self._smile_legacy = False
263262
self._stretch_v2 = False
264263
self._stretch_v3 = False

plugwise/smile.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ def _device_data_climate(
144144
device_data["preset_modes"] = None
145145
device_data["active_preset"] = None
146146
if presets := self._presets(loc_id):
147-
self._presets_list = list(presets)
147+
presets_list = list(presets)
148148
# Adam does not show vacation preset anymore, issue #185
149149
if self.smile_name == "Adam":
150-
self._presets_list.remove("vacation")
151-
device_data["preset_modes"] = self._presets_list
150+
presets_list.remove("vacation")
151+
device_data["preset_modes"] = presets_list
152152

153153
device_data["active_preset"] = self._preset(loc_id)
154154

@@ -553,7 +553,7 @@ async def _set_preset_legacy(self, preset: str) -> None:
553553

554554
async def set_preset(self, loc_id: str, preset: str) -> None:
555555
"""Set the given Preset on the relevant Thermostat - from LOCATIONS."""
556-
if preset not in self._presets_list:
556+
if preset not in self._presets(loc_id):
557557
raise PlugwiseError("Plugwise: invalid preset.")
558558

559559
if self._smile_legacy:
@@ -564,9 +564,6 @@ async def set_preset(self, loc_id: str, preset: str) -> None:
564564
location_name = current_location.find("name").text
565565
location_type = current_location.find("type").text
566566

567-
if preset not in self._presets(loc_id):
568-
raise PlugwiseError("Plugwise: invalid preset.")
569-
570567
uri = f"{LOCATIONS};id={loc_id}"
571568
data = (
572569
"<locations><location"

0 commit comments

Comments
 (0)