Skip to content

Commit 5d63d3e

Browse files
committed
Improve
1 parent 39fef1a commit 5d63d3e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

plugwise/helper.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -794,17 +794,15 @@ def _presets(self, loc_id: str) -> dict[str, list[float]]:
794794

795795
for directive in directives:
796796
preset = directive.find("then").attrib
797-
LOGGER.debug("HOI %s", preset)
798-
keys, dummy = zip(*preset.items())
799-
if str(keys[0]) == "setpoint":
797+
if "setpoint" in preset:
800798
presets[directive.attrib["preset"]] = [
801-
float(preset.get("setpoint")),
799+
float(preset["setpoint"]),
802800
0,
803801
]
804802
else:
805803
presets[directive.attrib["preset"]] = [
806-
float(preset.get("heating_setpoint")),
807-
float(preset.get("cooling_setpoint")),
804+
float(preset["heating_setpoint"]),
805+
float(preset["cooling_setpoint"]),
808806
]
809807

810808
return presets

0 commit comments

Comments
 (0)