Parcourir la source

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 il y a 1 jour
Parent
commit
aa3d4ac734
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  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:
                     else:
                         if "dps" in poll:
                         if "dps" in poll:
                             poll = poll["dps"]
                             poll = poll["dps"]
-                        poll["full_poll"] = full_poll
-                        yield poll
+                        if isinstance(poll, dict):
+                            poll["full_poll"] = full_poll
+                            yield poll
 
 
             except CancelledError:
             except CancelledError:
                 self._running = False
                 self._running = False