mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Use _get_reauth_entry in trafikverket_weatherstation (#127316)
This commit is contained in:
parent
781c3eed2f
commit
56e79de707
@ -26,7 +26,7 @@ class TVWeatherConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
VERSION = 1
|
VERSION = 1
|
||||||
|
|
||||||
entry: ConfigEntry | None = None
|
entry: ConfigEntry
|
||||||
|
|
||||||
async def validate_input(self, sensor_api: str, station: str) -> None:
|
async def validate_input(self, sensor_api: str, station: str) -> None:
|
||||||
"""Validate input from user input."""
|
"""Validate input from user input."""
|
||||||
@ -80,7 +80,7 @@ class TVWeatherConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle re-authentication with Trafikverket."""
|
"""Handle re-authentication with Trafikverket."""
|
||||||
|
|
||||||
self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
self.entry = self._get_reauth_entry()
|
||||||
return await self.async_step_reauth_confirm()
|
return await self.async_step_reauth_confirm()
|
||||||
|
|
||||||
async def async_step_reauth_confirm(
|
async def async_step_reauth_confirm(
|
||||||
@ -92,8 +92,6 @@ class TVWeatherConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
if user_input:
|
if user_input:
|
||||||
api_key = user_input[CONF_API_KEY]
|
api_key = user_input[CONF_API_KEY]
|
||||||
|
|
||||||
assert self.entry is not None
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await self.validate_input(api_key, self.entry.data[CONF_STATION])
|
await self.validate_input(api_key, self.entry.data[CONF_STATION])
|
||||||
except InvalidAuthentication:
|
except InvalidAuthentication:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user