Use _get_reconfigure_entry in smhi (#127309)
This commit is contained in:
parent
2dce115732
commit
4974202bb4
1 changed files with 2 additions and 5 deletions
|
@ -40,7 +40,7 @@ class SmhiFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||||
"""Config flow for SMHI component."""
|
"""Config flow for SMHI component."""
|
||||||
|
|
||||||
VERSION = 2
|
VERSION = 2
|
||||||
config_entry: ConfigEntry | None
|
config_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
|
||||||
|
@ -86,9 +86,7 @@ class SmhiFlowHandler(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."""
|
||||||
self.config_entry = self.hass.config_entries.async_get_entry(
|
self.config_entry = self._get_reconfigure_entry()
|
||||||
self.context["entry_id"]
|
|
||||||
)
|
|
||||||
return await self.async_step_reconfigure_confirm()
|
return await self.async_step_reconfigure_confirm()
|
||||||
|
|
||||||
async def async_step_reconfigure_confirm(
|
async def async_step_reconfigure_confirm(
|
||||||
|
@ -96,7 +94,6 @@ class SmhiFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle a reconfiguration flow initialized by the user."""
|
"""Handle a reconfiguration flow initialized by the user."""
|
||||||
errors: dict[str, str] = {}
|
errors: dict[str, str] = {}
|
||||||
assert self.config_entry
|
|
||||||
|
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
lat: float = user_input[CONF_LOCATION][CONF_LATITUDE]
|
lat: float = user_input[CONF_LOCATION][CONF_LATITUDE]
|
||||||
|
|
Loading…
Add table
Reference in a new issue