Skip to content

Commit

Permalink
#43 fix config flow authentication wihout timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
leeyuentuen committed Jan 4, 2024
1 parent 8e86b9c commit 0c8f3e5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions custom_components/polestar_api/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Config flow for the Polestar EV platform."""

import asyncio
from asyncio import timeout
import logging

from aiohttp import ClientError
Expand All @@ -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__)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0c8f3e5

Please sign in to comment.