From 306486edfda581e9b30de8bcea0be58f7d66936f Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 29 Jun 2022 11:51:57 +0200 Subject: [PATCH] Adjust async_step_reauth in smarttub (#74170) --- homeassistant/components/smarttub/config_flow.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/smarttub/config_flow.py b/homeassistant/components/smarttub/config_flow.py index 88ec38e8d63..ec3dcb9c97f 100644 --- a/homeassistant/components/smarttub/config_flow.py +++ b/homeassistant/components/smarttub/config_flow.py @@ -1,9 +1,15 @@ """Config flow to configure the SmartTub integration.""" +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any + from smarttub import LoginFailed import voluptuous as vol from homeassistant import config_entries from homeassistant.const import CONF_EMAIL, CONF_PASSWORD +from homeassistant.data_entry_flow import FlowResult from .const import DOMAIN from .controller import SmartTubController @@ -21,8 +27,8 @@ class SmartTubConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): def __init__(self) -> None: """Instantiate config flow.""" super().__init__() - self._reauth_input = None - self._reauth_entry = None + self._reauth_input: Mapping[str, Any] | None = None + self._reauth_entry: config_entries.ConfigEntry | None = None async def async_step_user(self, user_input=None): """Handle a flow initiated by the user.""" @@ -60,9 +66,9 @@ class SmartTubConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): step_id="user", data_schema=DATA_SCHEMA, errors=errors ) - async def async_step_reauth(self, user_input=None): + async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: """Get new credentials if the current ones don't work anymore.""" - self._reauth_input = dict(user_input) + self._reauth_input = entry_data self._reauth_entry = self.hass.config_entries.async_get_entry( self.context["entry_id"] )