diff --git a/homeassistant/components/holiday/config_flow.py b/homeassistant/components/holiday/config_flow.py index 32b85b5a41d5fce84a8977f18df397efc45a8c3b..0284ac5c876f116faad6081a8727dc74202d8239 100644 --- a/homeassistant/components/holiday/config_flow.py +++ b/homeassistant/components/holiday/config_flow.py @@ -8,7 +8,7 @@ from babel import Locale, UnknownLocaleError from holidays import list_supported_countries import voluptuous as vol -from homeassistant.config_entries import ConfigEntry, ConfigFlow, ConfigFlowResult +from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from homeassistant.const import CONF_COUNTRY from homeassistant.helpers.selector import ( CountrySelector, @@ -27,7 +27,6 @@ class HolidayConfigFlow(ConfigFlow, domain=DOMAIN): """Handle a config flow for Holiday.""" VERSION = 1 - config_entry: ConfigEntry def __init__(self) -> None: """Initialize the config flow.""" @@ -115,15 +114,15 @@ class HolidayConfigFlow(ConfigFlow, domain=DOMAIN): self, user_input: dict[str, Any] | None = None ) -> ConfigFlowResult: """Handle the re-configuration of a province.""" - self.config_entry = self._get_reconfigure_entry() return await self.async_step_reconfigure_confirm() async def async_step_reconfigure_confirm( self, user_input: dict[str, Any] | None = None ) -> ConfigFlowResult: """Handle the re-configuration of a province.""" + reconfigure_entry = self._get_reconfigure_entry() if user_input is not None: - combined_input: dict[str, Any] = {**self.config_entry.data, **user_input} + combined_input: dict[str, Any] = {**reconfigure_entry.data, **user_input} country = combined_input[CONF_COUNTRY] province = combined_input.get(CONF_PROVINCE) @@ -145,10 +144,7 @@ class HolidayConfigFlow(ConfigFlow, domain=DOMAIN): name = f"{locale.territories[country]}{province_str}" return self.async_update_reload_and_abort( - self.config_entry, - title=name, - data=combined_input, - reason="reconfigure_successful", + reconfigure_entry, title=name, data=combined_input ) province_schema = vol.Schema( @@ -156,7 +152,7 @@ class HolidayConfigFlow(ConfigFlow, domain=DOMAIN): vol.Optional(CONF_PROVINCE): SelectSelector( SelectSelectorConfig( options=SUPPORTED_COUNTRIES[ - self.config_entry.data[CONF_COUNTRY] + reconfigure_entry.data[CONF_COUNTRY] ], mode=SelectSelectorMode.DROPDOWN, )