Reduce heartbeat interval.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
||||
__pycache__
|
||||
.tox
|
||||
tuyadebug/
|
||||
.pre-commit-config.yaml
|
@@ -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):
|
||||
|
@@ -74,7 +74,7 @@ MESSAGE_END_FMT = ">2I" # 2*uint32: crc, suffix
|
||||
PREFIX_VALUE = 0x000055AA
|
||||
SUFFIX_VALUE = 0x0000AA55
|
||||
|
||||
HEARTBEAT_INTERVAL = 20
|
||||
HEARTBEAT_INTERVAL = 10
|
||||
|
||||
# This is intended to match requests.json payload at
|
||||
# https://github.com/codetheweb/tuyapi :
|
||||
|
Reference in New Issue
Block a user