From 30580d3e691d5bf8131baa8d99062994275900bf Mon Sep 17 00:00:00 2001 From: mrlt8 <67088095+mrlt8@users.noreply.github.com> Date: Thu, 16 Mar 2023 21:02:58 -0700 Subject: [PATCH] Allow empty exception #746 --- app/wyzebridge/wyze_control.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/wyzebridge/wyze_control.py b/app/wyzebridge/wyze_control.py index 6a087418..b932213f 100644 --- a/app/wyzebridge/wyze_control.py +++ b/app/wyzebridge/wyze_control.py @@ -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}")