From b38694fbcd1b603f2e5a4354e884087b1ec4c181 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 9 Oct 2024 17:12:46 +0200 Subject: [PATCH] Do not cache the reconfigure entry in here travel time config flow (#128003) --- .../components/here_travel_time/config_flow.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/here_travel_time/config_flow.py b/homeassistant/components/here_travel_time/config_flow.py index d5a577aff9d..4376ae793c0 100644 --- a/homeassistant/components/here_travel_time/config_flow.py +++ b/homeassistant/components/here_travel_time/config_flow.py @@ -103,8 +103,6 @@ class HERETravelTimeConfigFlow(ConfigFlow, domain=DOMAIN): VERSION = 1 - _entry: ConfigEntry - def __init__(self) -> None: """Init Config Flow.""" self._config: dict[str, Any] = {} @@ -144,9 +142,9 @@ class HERETravelTimeConfigFlow(ConfigFlow, domain=DOMAIN): self, user_input: dict[str, Any] | None = None ) -> ConfigFlowResult: """Handle reconfiguration.""" - self._entry = self._get_reconfigure_entry() return self.async_show_form( - step_id="user", data_schema=get_user_step_schema(self._entry.data.copy()) + step_id="user", + data_schema=get_user_step_schema(self._get_reconfigure_entry().data), ) async def async_step_origin_menu(self, _: None = None) -> ConfigFlowResult: @@ -232,10 +230,9 @@ class HERETravelTimeConfigFlow(ConfigFlow, domain=DOMAIN): self._config.pop(CONF_DESTINATION_ENTITY_ID, None) if self.source == SOURCE_RECONFIGURE: return self.async_update_reload_and_abort( - self._entry, + self._get_reconfigure_entry(), title=self._config[CONF_NAME], data=self._config, - reason="reconfigure_successful", ) return self.async_create_entry( title=self._config[CONF_NAME], @@ -277,7 +274,7 @@ class HERETravelTimeConfigFlow(ConfigFlow, domain=DOMAIN): self._config.pop(CONF_DESTINATION_LONGITUDE, None) if self.source == SOURCE_RECONFIGURE: return self.async_update_reload_and_abort( - self._entry, data=self._config, reason="reconfigure_successful" + self._get_reconfigure_entry(), data=self._config ) return self.async_create_entry( title=self._config[CONF_NAME],