mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Use _get_reauth_entry in caldav config flow (#127384)
This commit is contained in:
parent
2b50f65c49
commit
44523168d7
@ -32,7 +32,7 @@ class CalDavConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
"""Handle a config flow for caldav."""
|
"""Handle a config flow for caldav."""
|
||||||
|
|
||||||
VERSION = 1
|
VERSION = 1
|
||||||
_reauth_entry: ConfigEntry | None = None
|
_reauth_entry: ConfigEntry
|
||||||
|
|
||||||
async def async_step_user(
|
async def async_step_user(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
@ -91,9 +91,7 @@ class CalDavConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
self, entry_data: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Perform reauth upon an API authentication error."""
|
"""Perform reauth upon an API authentication error."""
|
||||||
self._reauth_entry = self.hass.config_entries.async_get_entry(
|
self._reauth_entry = self._get_reauth_entry()
|
||||||
self.context["entry_id"]
|
|
||||||
)
|
|
||||||
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(
|
||||||
@ -101,7 +99,6 @@ class CalDavConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Confirm reauth dialog."""
|
"""Confirm reauth dialog."""
|
||||||
errors = {}
|
errors = {}
|
||||||
assert self._reauth_entry
|
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
user_input = {**self._reauth_entry.data, **user_input}
|
user_input = {**self._reauth_entry.data, **user_input}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user