Просмотр исходного кода

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 3 лет назад
Родитель
Сommit
87f319bb1e
1 измененных файлов с 2 добавлено и 0 удалено
  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_version_index = None
         self._api_protocol_working = False
         self._api_protocol_working = False
         self._api = tinytuya.Device(dev_id, address, local_key)
         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._refresh_task = None
         self._protocol_configured = protocol_version
         self._protocol_configured = protocol_version
         self._poll_only = poll_only
         self._poll_only = poll_only