Do not cache the reconfigure entry in google travel time config flow (#128002)

This commit is contained in:
epenet 2024-10-09 15:07:48 +02:00 committed by GitHub
parent c096cc23df
commit dd08381167
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -207,8 +207,6 @@ class GoogleTravelTimeConfigFlow(ConfigFlow, domain=DOMAIN):
VERSION = 1 VERSION = 1
_context_entry: ConfigEntry
@staticmethod @staticmethod
@callback @callback
def async_get_options_flow( def async_get_options_flow(
@ -240,7 +238,6 @@ class GoogleTravelTimeConfigFlow(ConfigFlow, domain=DOMAIN):
self, user_input: dict[str, Any] | None = None self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult: ) -> ConfigFlowResult:
"""Handle reconfiguration.""" """Handle reconfiguration."""
self._context_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(
@ -252,15 +249,13 @@ class GoogleTravelTimeConfigFlow(ConfigFlow, domain=DOMAIN):
errors = await validate_input(self.hass, user_input) errors = await validate_input(self.hass, user_input)
if not errors: if not errors:
return self.async_update_reload_and_abort( return self.async_update_reload_and_abort(
self._context_entry, self._get_reconfigure_entry(), data=user_input
data=user_input,
reason="reconfigure_successful",
) )
return self.async_show_form( return self.async_show_form(
step_id="reconfigure_confirm", step_id="reconfigure_confirm",
data_schema=self.add_suggested_values_to_schema( data_schema=self.add_suggested_values_to_schema(
RECONFIGURE_SCHEMA, self._context_entry.data.copy() RECONFIGURE_SCHEMA, self._get_reconfigure_entry().data
), ),
errors=errors, errors=errors,
) )