Преглед изворни кода

Revert "fix(device): ensure receive loop knows when the socket has been closed"

This reverts commit b121da233167720bcc56cf114c845746061cf11b.
Jason Rumney пре 1 дан
родитељ
комит
c504d683c9
1 измењених фајлова са 0 додато и 4 уклоњено
  1. 0 4
      custom_components/tuya_local/device.py

+ 0 - 4
custom_components/tuya_local/device.py

@@ -227,7 +227,6 @@ class TuyaLocalDevice(object):
         self._children.clear()
         self._children.clear()
         self._force_dps.clear()
         self._force_dps.clear()
         if self._refresh_task:
         if self._refresh_task:
-            self._temporary_poll = True
             self._api.set_socketPersistent(False)
             self._api.set_socketPersistent(False)
             if self._api.parent:
             if self._api.parent:
                 self._api.parent.set_socketPersistent(False)
                 self._api.parent.set_socketPersistent(False)
@@ -310,7 +309,6 @@ class TuyaLocalDevice(object):
         finally:
         finally:
             # Ensure the persistent connection is closed when the loop exits
             # Ensure the persistent connection is closed when the loop exits
             # and device appears as unavailable
             # and device appears as unavailable
-            self._temporary_poll = True
             self._api.set_socketPersistent(False)
             self._api.set_socketPersistent(False)
             if self._api.parent:
             if self._api.parent:
                 self._api.parent.set_socketPersistent(False)
                 self._api.parent.set_socketPersistent(False)
@@ -470,7 +468,6 @@ class TuyaLocalDevice(object):
             await asyncio.sleep(5 if force_backoff else 0.1)
             await asyncio.sleep(5 if force_backoff else 0.1)
 
 
         # Close the persistent connection when exiting the loop
         # Close the persistent connection when exiting the loop
-        self._temporary_poll = True
         self._api.set_socketPersistent(False)
         self._api.set_socketPersistent(False)
         if self._api.parent:
         if self._api.parent:
             self._api.parent.set_socketPersistent(False)
             self._api.parent.set_socketPersistent(False)
@@ -722,7 +719,6 @@ class TuyaLocalDevice(object):
                     connections,
                     connections,
                 )
                 )
                 # Ensure we have a fresh connection for the next attempt
                 # Ensure we have a fresh connection for the next attempt
-                self._temporary_poll = True
                 self._api.set_socketPersistent(False)
                 self._api.set_socketPersistent(False)
                 if self._api.parent:
                 if self._api.parent:
                     self._api.parent.set_socketPersistent(False)
                     self._api.parent.set_socketPersistent(False)