|
|
@@ -270,7 +270,17 @@ class TuyaLocalDevice(object):
|
|
|
|
|
|
for entity in self._children:
|
|
|
# let entities trigger off poll contents directly
|
|
|
- entity.on_receive(poll, full_poll)
|
|
|
+ try:
|
|
|
+ entity.on_receive(poll, full_poll)
|
|
|
+ except Exception as e:
|
|
|
+ # Don't let exceptions thrown by the entities interrupt the communication loop
|
|
|
+ # Just log them and move on.
|
|
|
+ _LOGGER.exception(
|
|
|
+ "%s on_receive error for entity %s: %s",
|
|
|
+ self.name,
|
|
|
+ entity.entity_id,
|
|
|
+ e,
|
|
|
+ )
|
|
|
# clear non-persistant dps that were not in a full poll
|
|
|
if full_poll:
|
|
|
for dp in entity._config.dps():
|