Use _get_reconfigure_entry in holiday (#127295)

This commit is contained in:
epenet 2024-10-02 14:31:19 +02:00 committed by GitHub
parent a19a069b21
commit f0f924a0a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,7 +28,7 @@ class HolidayConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle a config flow for Holiday."""
VERSION = 1
config_entry: ConfigEntry | None
config_entry: ConfigEntry
def __init__(self) -> None:
"""Initialize the config flow."""
@ -116,17 +116,13 @@ class HolidayConfigFlow(ConfigFlow, domain=DOMAIN):
self, entry_data: Mapping[str, Any]
) -> ConfigFlowResult:
"""Handle the re-configuration of a province."""
self.config_entry = self.hass.config_entries.async_get_entry(
self.context["entry_id"]
)
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."""
assert self.config_entry
if user_input is not None:
combined_input: dict[str, Any] = {**self.config_entry.data, **user_input}