diff --git a/pyIndego/indego_async_client.py b/pyIndego/indego_async_client.py index 704b5ee..a292b6c 100644 --- a/pyIndego/indego_async_client.py +++ b/pyIndego/indego_async_client.py @@ -417,7 +417,7 @@ async def update_state(self, force=False, longpoll=False, longpoll_timeout=120): if force: path = f"{path}%sforceRefresh=true" % ("&" if longpoll else "?") - self._update_state(await self.get(path, timeout=longpoll_timeout + 10)) + self._update_state(await self.get(path, timeout=(longpoll_timeout + 10) if longpoll else 10)) async def get_state(self, force=False, longpoll=False, longpoll_timeout=120): """Update state and return it. diff --git a/pyIndego/indego_client.py b/pyIndego/indego_client.py index cc0a612..442148f 100644 --- a/pyIndego/indego_client.py +++ b/pyIndego/indego_client.py @@ -345,7 +345,7 @@ def update_state(self, force=False, longpoll=False, longpoll_timeout=120): else: path = f"{path}?forceRefresh=true" - self._update_state(self.get(path, timeout=longpoll_timeout + 30)) + self._update_state(self.get(path, timeout=(longpoll_timeout + 10) if longpoll else 10)) def get_state(self, force=False, longpoll=False, longpoll_timeout=120): """Update state. Can be both forced and with longpoll.