mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Use _get_reauth/reconfigure_entry in fritzbox (#127284)
This commit is contained in:
parent
84a4fe7b03
commit
f6c7ade579
@ -43,9 +43,10 @@ class FritzboxConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
VERSION = 1
|
VERSION = 1
|
||||||
|
|
||||||
|
_entry: ConfigEntry
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""Initialize flow."""
|
"""Initialize flow."""
|
||||||
self._entry: ConfigEntry | None = None
|
|
||||||
self._host: str | None = None
|
self._host: str | None = None
|
||||||
self._name: str | None = None
|
self._name: str | None = None
|
||||||
self._password: str | None = None
|
self._password: str | None = None
|
||||||
@ -62,7 +63,6 @@ class FritzboxConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def _update_entry(self) -> None:
|
async def _update_entry(self) -> None:
|
||||||
assert self._entry is not None
|
|
||||||
self.hass.config_entries.async_update_entry(
|
self.hass.config_entries.async_update_entry(
|
||||||
self._entry,
|
self._entry,
|
||||||
data={
|
data={
|
||||||
@ -184,9 +184,7 @@ class FritzboxConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
self, entry_data: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Trigger a reauthentication flow."""
|
"""Trigger a reauthentication flow."""
|
||||||
entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
self._entry = self._get_reauth_entry()
|
||||||
assert entry is not None
|
|
||||||
self._entry = entry
|
|
||||||
self._host = entry_data[CONF_HOST]
|
self._host = entry_data[CONF_HOST]
|
||||||
self._name = str(entry_data[CONF_HOST])
|
self._name = str(entry_data[CONF_HOST])
|
||||||
self._username = entry_data[CONF_USERNAME]
|
self._username = entry_data[CONF_USERNAME]
|
||||||
@ -228,9 +226,7 @@ class FritzboxConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
self, entry_data: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle a reconfiguration flow initialized by the user."""
|
"""Handle a reconfiguration flow initialized by the user."""
|
||||||
entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
self._entry = self._get_reconfigure_entry()
|
||||||
assert entry is not None
|
|
||||||
self._entry = entry
|
|
||||||
self._name = self._entry.data[CONF_HOST]
|
self._name = self._entry.data[CONF_HOST]
|
||||||
self._host = self._entry.data[CONF_HOST]
|
self._host = self._entry.data[CONF_HOST]
|
||||||
self._username = self._entry.data[CONF_USERNAME]
|
self._username = self._entry.data[CONF_USERNAME]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user