|
@@ -125,7 +125,7 @@ class TuyaLocalDevice(object):
|
|
|
"tuyadevice": self._api,
|
|
"tuyadevice": self._api,
|
|
|
"tuyadevicelock": self._api_lock,
|
|
"tuyadevicelock": self._api_lock,
|
|
|
}
|
|
}
|
|
|
- except Exception as e:
|
|
|
|
|
|
|
+ except BaseException as e:
|
|
|
_LOGGER.error(
|
|
_LOGGER.error(
|
|
|
"%s: %s while initialising device %s",
|
|
"%s: %s while initialising device %s",
|
|
|
type(e).__name__,
|
|
type(e).__name__,
|
|
@@ -277,7 +277,7 @@ class TuyaLocalDevice(object):
|
|
|
# let entities trigger off poll contents directly
|
|
# let entities trigger off poll contents directly
|
|
|
try:
|
|
try:
|
|
|
entity.on_receive(poll, full_poll)
|
|
entity.on_receive(poll, full_poll)
|
|
|
- except Exception as e:
|
|
|
|
|
|
|
+ except BaseException as e:
|
|
|
# Don't let exceptions thrown by the entities interrupt the communication loop
|
|
# Don't let exceptions thrown by the entities interrupt the communication loop
|
|
|
# Just log them and move on.
|
|
# Just log them and move on.
|
|
|
_LOGGER.exception(
|
|
_LOGGER.exception(
|
|
@@ -286,6 +286,7 @@ class TuyaLocalDevice(object):
|
|
|
entity.entity_id,
|
|
entity.entity_id,
|
|
|
e,
|
|
e,
|
|
|
)
|
|
)
|
|
|
|
|
+
|
|
|
# clear non-persistant dps that were not in a full poll
|
|
# clear non-persistant dps that were not in a full poll
|
|
|
if full_poll:
|
|
if full_poll:
|
|
|
for dp in entity._config.dps():
|
|
for dp in entity._config.dps():
|
|
@@ -300,7 +301,7 @@ class TuyaLocalDevice(object):
|
|
|
)
|
|
)
|
|
|
_LOGGER.warning("%s receive loop has terminated", self.name)
|
|
_LOGGER.warning("%s receive loop has terminated", self.name)
|
|
|
|
|
|
|
|
- except Exception as t:
|
|
|
|
|
|
|
+ except BaseException as t:
|
|
|
_LOGGER.exception(
|
|
_LOGGER.exception(
|
|
|
"%s receive loop terminated by exception %s", self.name, t
|
|
"%s receive loop terminated by exception %s", self.name, t
|
|
|
)
|
|
)
|
|
@@ -448,7 +449,7 @@ class TuyaLocalDevice(object):
|
|
|
if self._api.parent:
|
|
if self._api.parent:
|
|
|
self._api.parent.set_socketPersistent(False)
|
|
self._api.parent.set_socketPersistent(False)
|
|
|
raise
|
|
raise
|
|
|
- except Exception as t:
|
|
|
|
|
|
|
+ except BaseException as t:
|
|
|
_LOGGER.exception(
|
|
_LOGGER.exception(
|
|
|
"%s receive loop error %s:%s",
|
|
"%s receive loop error %s:%s",
|
|
|
self.name,
|
|
self.name,
|
|
@@ -705,7 +706,7 @@ class TuyaLocalDevice(object):
|
|
|
self._api_protocol_working = True
|
|
self._api_protocol_working = True
|
|
|
self._api_working_protocol_failures = 0
|
|
self._api_working_protocol_failures = 0
|
|
|
return retval
|
|
return retval
|
|
|
- except Exception as e:
|
|
|
|
|
|
|
+ except BaseException as e:
|
|
|
_LOGGER.debug(
|
|
_LOGGER.debug(
|
|
|
"Retrying after exception %s %s (%d/%d)",
|
|
"Retrying after exception %s %s (%d/%d)",
|
|
|
type(e).__name__,
|
|
type(e).__name__,
|