From 3a4940387c55b816fc9573c2030235305b17a4d5 Mon Sep 17 00:00:00 2001 From: ultratoto14 Date: Thu, 17 Dec 2020 15:01:02 +0100 Subject: [PATCH] Use debug message for timeout. --- custom_components/localtuya/pytuya/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/custom_components/localtuya/pytuya/__init__.py b/custom_components/localtuya/pytuya/__init__.py index 59fd929..789091c 100644 --- a/custom_components/localtuya/pytuya/__init__.py +++ b/custom_components/localtuya/pytuya/__init__.py @@ -383,6 +383,9 @@ class TuyaProtocol(asyncio.Protocol, ContextualLogger): except asyncio.CancelledError: self.debug("Stopped heartbeat loop") raise + except asyncio.TimeoutError: + self.debug("Heartbeat failed due to timeout, disconnecting") + break except Exception as ex: # pylint: disable=broad-except self.exception("Heartbeat failed (%s), disconnecting", ex) break