Skip to content

Commit

Permalink
Update FlowManager to latest HA requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
stickpin committed Mar 2, 2024
1 parent 200672f commit 3cb0595
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions custom_components/volkswagencarnet/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import logging
import asyncio

from typing import Optional

import homeassistant.helpers.config_validation as cv
Expand Down Expand Up @@ -54,8 +56,8 @@

class VolkswagenCarnetConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
VERSION = 3
task_login = None
task_finish = None
task_login: asyncio.Task | None = None
task_finish: asyncio.Task | None = None
entry = None

def __init__(self):
Expand Down Expand Up @@ -152,6 +154,7 @@ async def async_step_login(self, user_input=None):
return self.async_show_progress(
step_id="login",
progress_action="task_login",
progress_task=self.task_login,
)

# noinspection PyBroadException
Expand Down Expand Up @@ -197,7 +200,8 @@ async def async_step_reauth_confirm(self, user_input: dict = None) -> dict:

if not await self._connection.validate_login:
_LOGGER.debug(
"Unable to login to WeConnect. Need to accept a new EULA? Try logging in to the portal: https://www.portal.volkswagen-we.com/"
"Unable to login to WeConnect. Need to accept a new EULA?"
"Try logging in to the portal: https://www.portal.volkswagen-we.com/"
)
errors["base"] = "cannot_connect"
else:
Expand Down

0 comments on commit 3cb0595

Please sign in to comment.