Преглед на файлове

Device: appear as available if it has returned empty polls

The condition for appearing available required data to have been returned
from the device since the last reconnection, but we now support devices that
don't return any data such as IR controls, and some devices do not seem
to return anything on reconnection until something changes. In those cases,
the state should appear as Unknown rather than unavailable.

May help with #1804
Jason Rumney преди 1 година
родител
ревизия
c885246f76
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      custom_components/tuya_local/device.py

+ 2 - 1
custom_components/tuya_local/device.py

@@ -153,7 +153,8 @@ class TuyaLocalDevice(object):
     @property
     def has_returned_state(self):
         """Return True if the device has returned some state."""
-        return len(self._get_cached_state()) > 1
+        cached = self._get_cached_state()
+        return len(cached) > 1 or cached.get("updated_at", 0) > 0
 
     @callback
     def actually_start(self, event=None):