|
@@ -406,7 +406,15 @@ class TuyaLocalDevice(object):
|
|
|
poll = None
|
|
poll = None
|
|
|
|
|
|
|
|
if poll:
|
|
if poll:
|
|
|
- if "Error" in poll:
|
|
|
|
|
|
|
+ if "Err" in poll:
|
|
|
|
|
+ # Limit disconnects to the errors that are caused low level
|
|
|
|
|
+ # communication problems
|
|
|
|
|
+ if poll["Err"] in {"901", "902", "905", "906", "914"}:
|
|
|
|
|
+ force_backoff = True
|
|
|
|
|
+ persist = False
|
|
|
|
|
+ self._api.set_socketPersistent(False)
|
|
|
|
|
+ if self._api.parent:
|
|
|
|
|
+ self._api.parent.set_socketPersistent(False)
|
|
|
# increment the error count if not done already
|
|
# increment the error count if not done already
|
|
|
if error_count == self._api_working_protocol_failures:
|
|
if error_count == self._api_working_protocol_failures:
|
|
|
self._api_working_protocol_failures += 1
|
|
self._api_working_protocol_failures += 1
|