Skip to content

Commit

Permalink
Add extra error-handling for when wrong target temp input is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
bouwew committed Jul 6, 2023
1 parent 3c5af24 commit f530023
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions plugwise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,14 @@ async def set_temperature(self, loc_id: str, items: dict[str, float]) -> None:
if "setpoint" in items:
setpoint = items["setpoint"]

if self._cooling_present and "setpoint_high" in items:
tmp_setpoint_high = items["setpoint_high"]
tmp_setpoint_low = items["setpoint_low"]
if self._cooling_present:
if "setpoint_high" in items:
tmp_setpoint_high = items["setpoint_high"]
tmp_setpoint_low = items["setpoint_low"]
else:
raise PlugwiseError(
"Plugwise: wrong target temperature provided, provide a target-temperature-high or -low."
)
if self._cooling_enabled: # in cooling mode
setpoint = tmp_setpoint_high
if tmp_setpoint_low != MIN_SETPOINT:
Expand Down

0 comments on commit f530023

Please sign in to comment.