From 0c8f3e505b464d3675571aba8d2eea23b141b59d Mon Sep 17 00:00:00 2001 From: Tuen Lee Date: Thu, 4 Jan 2024 09:52:21 +0100 Subject: [PATCH] #43 fix config flow authentication wihout timeout --- custom_components/polestar_api/config_flow.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/custom_components/polestar_api/config_flow.py b/custom_components/polestar_api/config_flow.py index 29ba38b..3a08ccf 100644 --- a/custom_components/polestar_api/config_flow.py +++ b/custom_components/polestar_api/config_flow.py @@ -1,6 +1,6 @@ """Config flow for the Polestar EV platform.""" + import asyncio -from asyncio import timeout import logging from aiohttp import ClientError @@ -9,7 +9,7 @@ from homeassistant import config_entries from homeassistant.const import CONF_PASSWORD, CONF_USERNAME -from .const import DOMAIN, TIMEOUT +from .const import DOMAIN from .polestar import Polestar _LOGGER = logging.getLogger(__name__) @@ -40,8 +40,7 @@ async def _create_device(self, username: str, password: str) -> None: self.hass, username, password) - with timeout(TIMEOUT): - await device.init() + await device.init() # check if we have a token, otherwise throw exception if device.polestarApi.auth.access_token is None: