Reduce heartbeat interval.

This commit is contained in:
ultratoto14
2020-12-15 17:12:52 +01:00
parent aeb27a4d75
commit 89dabfc105
3 changed files with 5 additions and 4 deletions

View File

@@ -150,10 +150,10 @@ class TuyaDevice(pytuya.TuyaListener, pytuya.ContextualLogger):
async def close(self):
"""Close connection and stop re-connect loop."""
self._is_closing = True
if self._connect_task:
if self._connect_task is not None:
self._connect_task.cancel()
await self._connect_task
if self._interface:
if self._interface is not None:
await self._interface.close()
async def set_dp(self, state, dp_index):