diff --git a/custom_components/localtuya/core/pytuya/__init__.py b/custom_components/localtuya/core/pytuya/__init__.py index 373898c7..ce1693a8 100644 --- a/custom_components/localtuya/core/pytuya/__init__.py +++ b/custom_components/localtuya/core/pytuya/__init__.py @@ -750,8 +750,6 @@ def disconnected(self, exc=""): class TuyaProtocol(asyncio.Protocol, ContextualLogger): """Implementation of the Tuya protocol.""" - HEARTBEAT_SKIP = 5 - def __init__( self, dev_id: str, @@ -925,9 +923,8 @@ async def heartbeat_loop(): self.debug("Started heartbeat loop") while True: try: - # if self.last_command_sent > self.HEARTBEAT_SKIP: - await self.heartbeat() await asyncio.sleep(HEARTBEAT_INTERVAL) + await self.heartbeat() except asyncio.CancelledError: self.debug("Stopped heartbeat loop") raise