Skip to content

Commit 4d2de5e

Browse files
committed
Correct mode-logic
1 parent a71b335 commit 4d2de5e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

plugwise/__init__.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,22 +220,21 @@ def _device_data_climate(
220220
device_data["select_schedule"] = sel_schedule
221221
self._count += 2
222222

223-
# Operation modes: auto, heat, heat_cool
223+
# Operation modes: auto, heat, heat_cool, cool and off
224+
gateway = self.gw_devices[self.gateway_id]
224225
device_data["mode"] = "auto"
225226
self._count += 1
226227
if sel_schedule == "None":
227228
device_data["mode"] = "heat"
228229
if self._cooling_present:
229230
device_data["mode"] = "heat_cool"
230-
231-
# Adam: add off-mode based on regulation_mode = off
232-
# or cool-mode for regulation_mode = cooling
233-
gateway = self.gw_devices[self.gateway_id]
231+
if "regulation_modes" in gateway:
232+
if gateway["select_regulation_mode"] == "cooling":
233+
device_data["mode"] = "cool"
234+
234235
if "regulation_modes" in gateway:
235236
if gateway["select_regulation_mode"] == "off":
236237
device_data["mode"] = "off"
237-
if gateway["select_regulation_mode"] == "cooling":
238-
device_data["mode"] = "cool"
239238

240239
if "None" not in avail_schedules:
241240
loc_schedule_states = {}

0 commit comments

Comments
 (0)