Skip to content

Commit a7b61c2

Browse files
committed
Improve handling of custom-setpoint in schedule
1 parent 9c57863 commit a7b61c2

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

plugwise/helper.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,16 +1254,22 @@ def _schedules(
12541254
directives = self._domain_objects.find(locator)
12551255
for directive in directives:
12561256
entry = directive.find("then").attrib
1257-
if "preset" in entry:
1257+
if "setpoint" in entry:
1258+
if not self._cooling_present or self._cooling_enabled:
1259+
schedule[directive.attrib["time"]] = [
1260+
float(entry["setpoint"]),
1261+
DEFAULT_PW_MAX,
1262+
]
1263+
else:
1264+
schedule[directive.attrib["time"]] = [
1265+
float(entry["setpoint"]),
1266+
DEFAULT_PW_MIN,
1267+
]
1268+
else: # preset in entry
12581269
schedule[directive.attrib["time"]] = [
12591270
float(self._presets(loc_id)[entry["preset"]][0]),
12601271
float(self._presets(loc_id)[entry["preset"]][1]),
12611272
]
1262-
else:
1263-
schedule[directive.attrib["time"]] = [
1264-
float(entry["heating_setpoint"]),
1265-
float(entry["cooling_setpoint"]),
1266-
]
12671273

12681274
available.append(name)
12691275
if location == loc_id:

0 commit comments

Comments
 (0)