mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 23:07:09 +00:00
Correct reconfigure flows to get data from config entry (#127393)
Fetch entry data in async_step_reconfigure
This commit is contained in:
parent
13e4cd4a49
commit
c658dc0ffc
@ -149,10 +149,11 @@ class AxisFlowHandler(ConfigFlow, domain=AXIS_DOMAIN):
|
|||||||
return self.async_create_entry(title=title, data=self.config)
|
return self.async_create_entry(title=title, data=self.config)
|
||||||
|
|
||||||
async def async_step_reconfigure(
|
async def async_step_reconfigure(
|
||||||
self, entry_data: Mapping[str, Any]
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Trigger a reconfiguration flow."""
|
"""Trigger a reconfiguration flow."""
|
||||||
return await self._redo_configuration(entry_data, keep_password=True)
|
entry = self._get_reconfigure_entry()
|
||||||
|
return await self._redo_configuration(entry.data, keep_password=True)
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(
|
||||||
self, entry_data: Mapping[str, Any]
|
self, entry_data: Mapping[str, Any]
|
||||||
|
@ -141,12 +141,12 @@ class HERETravelTimeConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reconfigure(
|
async def async_step_reconfigure(
|
||||||
self, entry_data: Mapping[str, Any]
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle reconfiguration."""
|
"""Handle reconfiguration."""
|
||||||
self._entry = self._get_reconfigure_entry()
|
self._entry = self._get_reconfigure_entry()
|
||||||
return self.async_show_form(
|
return self.async_show_form(
|
||||||
step_id="user", data_schema=get_user_step_schema(entry_data)
|
step_id="user", data_schema=get_user_step_schema(self._entry.data.copy())
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_origin_menu(self, _: None = None) -> ConfigFlowResult:
|
async def async_step_origin_menu(self, _: None = None) -> ConfigFlowResult:
|
||||||
|
@ -399,12 +399,12 @@ class ShellyConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reconfigure(
|
async def async_step_reconfigure(
|
||||||
self, entry_data: Mapping[str, Any]
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle a reconfiguration flow initialized by the user."""
|
"""Handle a reconfiguration flow initialized by the user."""
|
||||||
self.host = entry_data[CONF_HOST]
|
|
||||||
self.port = entry_data.get(CONF_PORT, DEFAULT_HTTP_PORT)
|
|
||||||
self.entry = self._get_reconfigure_entry()
|
self.entry = self._get_reconfigure_entry()
|
||||||
|
self.host = self.entry.data[CONF_HOST]
|
||||||
|
self.port = self.entry.data.get(CONF_PORT, DEFAULT_HTTP_PORT)
|
||||||
|
|
||||||
return await self.async_step_reconfigure_confirm()
|
return await self.async_step_reconfigure_confirm()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user