Jason Rumney 2 лет назад
Родитель
Сommit
3138fe3d47
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      custom_components/tuya_local/device.py

+ 4 - 2
custom_components/tuya_local/device.py

@@ -455,7 +455,8 @@ class TuyaLocalDevice(object):
 
     def _remove_properties_from_pending_updates(self, data):
         self._pending_updates = {
-            key: value for key, value in self._pending_updates.items()
+            key: value
+            for key, value in self._pending_updates.items()
             if key not in data or not value["sent"] or data[key] != value["value"]
         }
 
@@ -568,7 +569,8 @@ class TuyaLocalDevice(object):
         self._pending_updates = {
             key: value
             for key, value in self._pending_updates.items()
-            if not value["sent"] or now - value.get("updated_at", 0) < self._FAKE_IT_TIMEOUT
+            if not value["sent"]
+            or now - value.get("updated_at", 0) < self._FAKE_IT_TIMEOUT
         }
         return self._pending_updates