Do not cache reconfigure entry in waze_travel_time config flow (#128030)

This commit is contained in:
epenet 2024-10-09 16:31:11 +02:00 committed by GitHub
parent fcaec2c3f4
commit 577ae6923a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -142,8 +142,6 @@ class WazeConfigFlow(ConfigFlow, domain=DOMAIN):
VERSION = 2
_entry: ConfigEntry
@staticmethod
@callback
def async_get_options_flow(
@ -169,10 +167,9 @@ class WazeConfigFlow(ConfigFlow, domain=DOMAIN):
):
if self.source == SOURCE_RECONFIGURE:
return self.async_update_reload_and_abort(
self._entry,
self._get_reconfigure_entry(),
title=user_input[CONF_NAME],
data=user_input,
reason="reconfigure_successful",
)
return self.async_create_entry(
title=user_input.get(CONF_NAME, DEFAULT_NAME),
@ -194,9 +191,7 @@ class WazeConfigFlow(ConfigFlow, domain=DOMAIN):
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle reconfiguration."""
self._entry = self._get_reconfigure_entry()
data = self._entry.data.copy()
data = self._get_reconfigure_entry().data.copy()
data[CONF_REGION] = data[CONF_REGION].lower()
return self.async_show_form(