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

Hande lost connection better #6

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
aiohttp>=3.8.1,<3.9.0
pycryptodome>=3.15.0,<3.20.0
aiohttp>=3.8
pycryptodome>=3.15,<3.20
async-class==0.5.0
voluptuous>=0.13.1,<0.14.0
voluptuous>=0.13
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

setup(
name="aioremootio",
version="1.0.0.dev0",
version="1.0.0",
description="An asynchronous API client library for Remootio (http://www.remootio.com/)",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/ivgg-me/aioremootio",
author="Gergö Gabor Ilyes-Veisz",
author_email="[email protected]",
url="https://github.com/peaceduck/aioremootio",
author="Fredrik Andersson",
author_email="[email protected]",
classifiers=[
"Development Status :: 3 - Alpha",
"Framework :: AsyncIO",
Expand Down
2 changes: 2 additions & 0 deletions src/aioremootio/remootioclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ async def __receive_and_handle_messages(self) -> NoReturn:
self.__logger.warning("Receiving and handling of messages by this client will be delayed "
"because connection to the device can't be established.")
await asyncio.sleep(MESSAGE_HANDLER_HEARTBEAT)
await self.__disconnect()
continue

if self.__is_ws_connected(ws):
Expand Down Expand Up @@ -800,6 +801,7 @@ async def __receive_and_handle_messages(self) -> NoReturn:
self.__logger.warning("Receiving and handling of messages by this client will be delayed "
"because connection to the device can't be established.")
await asyncio.sleep(MESSAGE_HANDLER_HEARTBEAT)
await self.__disconnect()
else:
self.__logger.info("Receiving and handling of messages by this client will be now stopped.")
return
Expand Down