Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce heartbeat interval. #239

Merged
merged 1 commit into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*~
__pycache__
.tox
tuyadebug/
tuyadebug/
.pre-commit-config.yaml
4 changes: 2 additions & 2 deletions custom_components/localtuya/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ async def _make_connection(self):
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):
Expand Down
2 changes: 1 addition & 1 deletion custom_components/localtuya/pytuya/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
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 :
Expand Down