Explorar o código

device: set tinytuya retry limit to 1

We have our own retry logic that rotates the api version to try to autodetect
which version is in use.  So we don't need tinytuya to be retrying 5 times
in background for each of our retries.

Issue #424
Jason Rumney %!s(int64=3) %!d(string=hai) anos
pai
achega
87f319bb1e
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      custom_components/tuya_local/device.py

+ 2 - 0
custom_components/tuya_local/device.py

@@ -67,6 +67,8 @@ class TuyaLocalDevice(object):
         self._api_protocol_version_index = None
         self._api_protocol_working = False
         self._api = tinytuya.Device(dev_id, address, local_key)
+        # we handle retries at a higher level so we can rotate protocol version
+        self._api.set_socketRetryLimit(1)
         self._refresh_task = None
         self._protocol_configured = protocol_version
         self._poll_only = poll_only