Reduce heartbeat interval.
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
*~
|
*~
|
||||||
__pycache__
|
__pycache__
|
||||||
.tox
|
.tox
|
||||||
tuyadebug/
|
tuyadebug/
|
||||||
|
.pre-commit-config.yaml
|
@@ -150,10 +150,10 @@ class TuyaDevice(pytuya.TuyaListener, pytuya.ContextualLogger):
|
|||||||
async def close(self):
|
async def close(self):
|
||||||
"""Close connection and stop re-connect loop."""
|
"""Close connection and stop re-connect loop."""
|
||||||
self._is_closing = True
|
self._is_closing = True
|
||||||
if self._connect_task:
|
if self._connect_task is not None:
|
||||||
self._connect_task.cancel()
|
self._connect_task.cancel()
|
||||||
await self._connect_task
|
await self._connect_task
|
||||||
if self._interface:
|
if self._interface is not None:
|
||||||
await self._interface.close()
|
await self._interface.close()
|
||||||
|
|
||||||
async def set_dp(self, state, dp_index):
|
async def set_dp(self, state, dp_index):
|
||||||
|
@@ -74,7 +74,7 @@ MESSAGE_END_FMT = ">2I" # 2*uint32: crc, suffix
|
|||||||
PREFIX_VALUE = 0x000055AA
|
PREFIX_VALUE = 0x000055AA
|
||||||
SUFFIX_VALUE = 0x0000AA55
|
SUFFIX_VALUE = 0x0000AA55
|
||||||
|
|
||||||
HEARTBEAT_INTERVAL = 20
|
HEARTBEAT_INTERVAL = 10
|
||||||
|
|
||||||
# This is intended to match requests.json payload at
|
# This is intended to match requests.json payload at
|
||||||
# https://github.com/codetheweb/tuyapi :
|
# https://github.com/codetheweb/tuyapi :
|
||||||
|
Reference in New Issue
Block a user