From d0d8de94dca002911a034117e5a5229f3d914ea2 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:28:11 +0200 Subject: [PATCH] Use _get_reconfigure_entry in tado (#127311) --- homeassistant/components/tado/config_flow.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/tado/config_flow.py b/homeassistant/components/tado/config_flow.py index 4832ce889f8..23642dcb14d 100644 --- a/homeassistant/components/tado/config_flow.py +++ b/homeassistant/components/tado/config_flow.py @@ -74,7 +74,7 @@ class TadoConfigFlow(ConfigFlow, domain=DOMAIN): """Handle a config flow for Tado.""" VERSION = 1 - config_entry: ConfigEntry | None + config_entry: ConfigEntry async def async_step_user( self, user_input: dict[str, Any] | None = None @@ -121,9 +121,7 @@ class TadoConfigFlow(ConfigFlow, domain=DOMAIN): self, entry_data: Mapping[str, Any] ) -> ConfigFlowResult: """Handle a reconfiguration flow initialized by the user.""" - 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( @@ -131,7 +129,6 @@ class TadoConfigFlow(ConfigFlow, domain=DOMAIN): ) -> ConfigFlowResult: """Handle a reconfiguration flow initialized by the user.""" errors: dict[str, str] = {} - assert self.config_entry if user_input is not None: user_input[CONF_USERNAME] = self.config_entry.data[CONF_USERNAME] -- GitLab