From 3166824af53e3077d9fb7566b54b52d6b52db7ab Mon Sep 17 00:00:00 2001 From: Daniel Muehlbachler-Pietrzykowski Date: Mon, 11 Dec 2023 11:19:40 +0100 Subject: [PATCH] fix: reduce backoff time for reconnects --- onyx_client/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onyx_client/client.py b/onyx_client/client.py index 72fbeed..115a063 100644 --- a/onyx_client/client.py +++ b/onyx_client/client.py @@ -263,7 +263,7 @@ async def events(self, include_details: bool = False) -> Device: "Received unknown device data. Dropping device %s", key ) - def start(self, include_details: bool = False, backoff_time: int = 3): + def start(self, include_details: bool = False, backoff_time: int = 1): """Start the event stream via callback. include_details: ensures all device details are queried @@ -293,7 +293,7 @@ def _create_internal_task(self, coro, name=None): task.add_done_callback(self._complete_internal_task) self._activeTasks.add(task) - async def _read_handler(self, include_details: bool = False, backoff_time: int = 3): + async def _read_handler(self, include_details: bool = False, backoff_time: int = 1): """Handle rerunning the task in the background. include_details: ensures all device details are queried