Skip to content

Commit a03458c

Browse files
committed
Follow plugwise naming
_cooling_active -> _cooling_enabled
1 parent 72be5b8 commit a03458c

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

plugwise/helper.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,10 @@ def __init__(self) -> None:
289289
self._appl_data: dict[str, ApplianceData] = {}
290290
self._appliances: etree
291291
self._allowed_modes: list[str] = []
292-
self._adam_cooling_active = False
293-
self._anna_cooling_active: bool | None = None
292+
self._adam_cooling_enabled = False
293+
self._anna_cooling_enabled: bool | None = None
294294
self._anna_cooling_present = False
295-
self._cooling_active = False
295+
self._cooling_enabled = False
296296
self._cooling_activation_outdoor_temp: float
297297
self._cooling_deactivation_threshold: float
298298
self._cooling_present = False
@@ -480,7 +480,7 @@ def _appliance_info_finder(self, appliance: etree, appl: Munch) -> Munch:
480480
mode_list: list[str] = []
481481
locator = "./actuator_functionalities/regulation_mode_control_functionality"
482482
if (search := appliance.find(locator)) is not None:
483-
self._adam_cooling_active = search.find("mode").text == "cooling"
483+
self._adam_cooling_enabled = search.find("mode").text == "cooling"
484484
if search.find("allowed_modes") is not None:
485485
for mode in search.find("allowed_modes"):
486486
mode_list.append(mode.text)
@@ -854,7 +854,7 @@ def _get_appliance_data(self, d_id: str) -> DeviceData:
854854

855855
# Use cooling_enabled to set self._anna_cooling_active, then remove
856856
if "cooling_enabled" in data:
857-
self._anna_cooling_active = data.get("cooling_enabled")
857+
self._anna_cooling_enabled = data.get("cooling_enabled")
858858
data.pop("cooling_enabled", None)
859859

860860
return data

plugwise/smile.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,17 @@ def get_all_devices(self) -> None:
109109

110110
# Anna: indicate possible active heating/cooling operation-mode
111111
# Actual ongoing heating/cooling is shown via heating_state/cooling_state
112-
if self._anna_cooling_present and self._anna_cooling_active is None:
112+
if self._anna_cooling_present and self._anna_cooling_enabled is None:
113113
if (
114-
not self._cooling_active
114+
not self._cooling_enabled
115115
and self._outdoor_temp > self._cooling_activation_outdoor_temp
116116
):
117-
self._cooling_active = True
117+
self._cooling_enabled = True
118118
if (
119-
self._cooling_active
119+
self._cooling_enabled
120120
and self._outdoor_temp < self._cooling_deactivation_threshold
121121
):
122-
self._cooling_active = False
122+
self._cooling_enabled = False
123123

124124
# Don't show cooling_state when no cooling present
125125
for _, device in self.gw_devices.items():
@@ -192,7 +192,7 @@ def _device_data_climate(
192192
if sched_setpoints is None:
193193
device_data["setpoint_low"] = device_data["setpoint"]
194194
device_data["setpoint_high"] = float(40)
195-
if self._cooling_active or self._anna_cooling_active:
195+
if self._cooling_enabled or self._anna_cooling_enabled:
196196
device_data["setpoint_low"] = float(0)
197197
device_data["setpoint_high"] = device_data["setpoint"]
198198
else:
@@ -212,7 +212,7 @@ def _device_data_climate(
212212
if self._heater_id is not None:
213213
if self._anna_cooling_present:
214214
device_data["mode"] = "heat_cool"
215-
if self.smile_name == "Adam" and self._adam_cooling_active:
215+
if self.smile_name == "Adam" and self._adam_cooling_enabled:
216216
device_data["mode"] = "cool"
217217

218218
return device_data

tests/test_smile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3135,8 +3135,8 @@ async def test_connect_anna_heatpump_cooling_to_off(self):
31353135
self.smile_setup = "anna_heatpump_cooling_to_off"
31363136
server, smile, client = await self.connect_wrapper()
31373137

3138-
# Preset _cooling_active to True, will turn to False due to the lowered outdoor temp
3139-
smile._cooling_active = True
3138+
# Preset _cooling_enabled to True, will turn to False due to the lowered outdoor temp
3139+
smile._cooling_enabled = True
31403140
await self.device_test(smile, testdata)
31413141
await smile.close_connection()
31423142
await self.disconnect(server, client)

0 commit comments

Comments
 (0)