Skip to content

Commit f26193c

Browse files
committed
Add extra error-handling for when wrong target temp input is provided
1 parent c8dabdb commit f26193c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

plugwise/__init__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,9 +681,14 @@ async def set_temperature(self, loc_id: str, items: dict[str, float]) -> None:
681681
if "setpoint" in items:
682682
setpoint = items["setpoint"]
683683

684-
if self._cooling_present and "setpoint_high" in items:
685-
tmp_setpoint_high = items["setpoint_high"]
686-
tmp_setpoint_low = items["setpoint_low"]
684+
if self._cooling_present:
685+
if "setpoint_high" in items:
686+
tmp_setpoint_high = items["setpoint_high"]
687+
tmp_setpoint_low = items["setpoint_low"]
688+
else:
689+
raise PlugwiseError(
690+
"Plugwise: wrong target temperature provided, provide a target-temperature-high or -low."
691+
)
687692
if self._cooling_enabled: # in cooling mode
688693
setpoint = tmp_setpoint_high
689694
if tmp_setpoint_low != MIN_SETPOINT:

0 commit comments

Comments
 (0)