Procházet zdrojové kódy

fix(device): don't try to add full_poll to non-dict returned data

Sometimes devices seem to return a tuple instead of a dict (empty result?).
Don't try to add full_poll to that, nor return it as a data response

Discussion #5148
Jason Rumney před 1 dnem
rodič
revize
aa3d4ac734
1 změnil soubory, kde provedl 3 přidání a 2 odebrání
  1. 3 2
      custom_components/tuya_local/device.py

+ 3 - 2
custom_components/tuya_local/device.py

@@ -415,8 +415,9 @@ class TuyaLocalDevice(object):
                     else:
                         if "dps" in poll:
                             poll = poll["dps"]
-                        poll["full_poll"] = full_poll
-                        yield poll
+                        if isinstance(poll, dict):
+                            poll["full_poll"] = full_poll
+                            yield poll
 
             except CancelledError:
                 self._running = False