Selaa lähdekoodia

fix (device): poll can be None

It seems to depend on protocol version whether poll comes back as None, or a
"null Payload" error.
Jason Rumney 5 päivää sitten
vanhempi
commit
2c5b4771c6
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      custom_components/tuya_local/device.py

+ 1 - 1
custom_components/tuya_local/device.py

@@ -370,7 +370,7 @@ class TuyaLocalDevice(object):
                     )
                     # Ignore Payload error 904, as 3.4 protocol devices seem to return
                     # this when there is no new data, instead of just returning nothing.
-                    if "Err" in poll and poll["Err"] == 904:
+                    if poll and "Err" in poll and poll["Err"] == 904:
                         poll = None
                 else:
                     force_backoff = True