Skip to content

Commit 7f2c583

Browse files
committed
Remove else
1 parent 6c4339c commit 7f2c583

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

plugwise/smile.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -433,18 +433,19 @@ async def set_temperature(self, loc_id: str, items: dict[str, float]) -> None:
433433
)
434434
tmp_setpoint_high = items["setpoint_high"]
435435
tmp_setpoint_low = items["setpoint_low"]
436-
if self._cooling_enabled: # in cooling mode
436+
# In heating mode
437+
setpoint = tmp_setpoint_low
438+
if tmp_setpoint_high != MAX_SETPOINT:
439+
raise PlugwiseError(
440+
"Plugwise: cooling setpoint cannot be changed when in heating mode"
441+
)
442+
# In cooling mode
443+
if self._cooling_enabled:
437444
setpoint = tmp_setpoint_high
438445
if tmp_setpoint_low != MIN_SETPOINT:
439446
raise PlugwiseError(
440447
"Plugwise: heating setpoint cannot be changed when in cooling mode"
441448
)
442-
else: # in heating mode
443-
setpoint = tmp_setpoint_low
444-
if tmp_setpoint_high != MAX_SETPOINT:
445-
raise PlugwiseError(
446-
"Plugwise: cooling setpoint cannot be changed when in heating mode"
447-
)
448449

449450
if setpoint is None:
450451
raise PlugwiseError(

0 commit comments

Comments
 (0)