mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Do not cache the reconfigure entry in feedreader config flow (#127989)
This commit is contained in:
parent
e8bc07d40f
commit
ff1ea46c46
@ -42,7 +42,6 @@ class FeedReaderConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
"""Handle a config flow."""
|
"""Handle a config flow."""
|
||||||
|
|
||||||
VERSION = 1
|
VERSION = 1
|
||||||
_config_entry: ConfigEntry
|
|
||||||
_max_entries: int | None = None
|
_max_entries: int | None = None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -124,17 +123,17 @@ class FeedReaderConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
self, user_input: dict[str, Any] | None = None
|
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._config_entry = self._get_reconfigure_entry()
|
|
||||||
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(
|
||||||
self, user_input: dict[str, Any] | None = None
|
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."""
|
||||||
|
reconfigure_entry = self._get_reconfigure_entry()
|
||||||
if not user_input:
|
if not user_input:
|
||||||
return self.show_user_form(
|
return self.show_user_form(
|
||||||
user_input={**self._config_entry.data},
|
user_input={**reconfigure_entry.data},
|
||||||
description_placeholders={"name": self._config_entry.title},
|
description_placeholders={"name": reconfigure_entry.title},
|
||||||
step_id="reconfigure_confirm",
|
step_id="reconfigure_confirm",
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -145,12 +144,12 @@ class FeedReaderConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
if isinstance(feed.bozo_exception, urllib.error.URLError):
|
if isinstance(feed.bozo_exception, urllib.error.URLError):
|
||||||
return self.show_user_form(
|
return self.show_user_form(
|
||||||
user_input=user_input,
|
user_input=user_input,
|
||||||
description_placeholders={"name": self._config_entry.title},
|
description_placeholders={"name": reconfigure_entry.title},
|
||||||
step_id="reconfigure_confirm",
|
step_id="reconfigure_confirm",
|
||||||
errors={"base": "url_error"},
|
errors={"base": "url_error"},
|
||||||
)
|
)
|
||||||
|
|
||||||
self.hass.config_entries.async_update_entry(self._config_entry, data=user_input)
|
self.hass.config_entries.async_update_entry(reconfigure_entry, data=user_input)
|
||||||
return self.async_abort(reason="reconfigure_successful")
|
return self.async_abort(reason="reconfigure_successful")
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user