Skip to content

Commit

Permalink
Allow empty exception #746
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlt8 committed Mar 17, 2023
1 parent e4bec03 commit 30580d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/wyzebridge/wyze_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,12 @@ def send_tutk_msg(sess: WyzeIOTCSession, cmd: str, source: str) -> dict:
try:
with sess.iotctrl_mux() as mux:
iotc = mux.send_ioctl(getattr(tutk_protocol, proto[0])(*proto[1:]))
if proto[0] in {"K11000SetRotaryByDegree"}:
if proto[0] in {"K11000SetRotaryByDegree", "K11004ResetRotatePosition"}:
resp |= {"status": "success", "response": None}
elif res := iotc.result(timeout=5):
resp |= {"status": "success", "response": ",".join(map(str, res))}
except Empty:
resp |= {"status": "success", "response": None}
except Exception as ex:
resp |= {"response": ex}
logger.warning(f"[CONTROL] {ex}")
Expand Down

0 comments on commit 30580d3

Please sign in to comment.