Skip to content

Commit

Permalink
fix: fix control_breeze_device bug
Browse files Browse the repository at this point in the history
Signed-off-by: Tomer Figenblat <tomer.figenblat@gmail.com>
  • Loading branch information
TomerFi committed Sep 24, 2022
1 parent a487a7c commit 97d9698
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/aioswitcher/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ async def control_breeze_device(
"logged in session_id=%s, timestamp=%s", login_resp.session_id, timestamp
)

cmd_response = None # type: SwitcherBaseResponse | None
if (
state
or mode
Expand Down Expand Up @@ -632,11 +633,13 @@ async def control_breeze_device(

if remote._separated_swing_command and swing:
# if device is SPECIAL SWING device and user requested a swing change
return await self._control_breeze_swing_device(
cmd_response = await self._control_breeze_swing_device(
timestamp, login_resp.session_id, remote, swing
)

return cmd_response
if cmd_response:
return cmd_response
raise RuntimeError("control breeze device failed")

async def _control_breeze_swing_device(
self,
Expand Down

0 comments on commit 97d9698

Please sign in to comment.