From befc73076949971f37b95d72a0f69d3dbf38d8d6 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 2 Oct 2024 14:53:48 +0200 Subject: [PATCH] Use _get_reauth/reconfigure_entry in mealie (#127301) Use _get_reconfigure_entry in mealie --- homeassistant/components/mealie/config_flow.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/mealie/config_flow.py b/homeassistant/components/mealie/config_flow.py index b67087b53bd..f4aee0ec29b 100644 --- a/homeassistant/components/mealie/config_flow.py +++ b/homeassistant/components/mealie/config_flow.py @@ -32,7 +32,7 @@ class MealieConfigFlow(ConfigFlow, domain=DOMAIN): host: str | None = None verify_ssl: bool = True - entry: ConfigEntry | None = None + entry: ConfigEntry async def check_connection( self, api_token: str @@ -89,7 +89,7 @@ class MealieConfigFlow(ConfigFlow, domain=DOMAIN): """Perform reauth upon an API authentication error.""" self.host = entry_data[CONF_HOST] self.verify_ssl = entry_data.get(CONF_VERIFY_SSL, True) - self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"]) + self.entry = self._get_reauth_entry() return await self.async_step_reauth_confirm() async def async_step_reauth_confirm( @@ -102,7 +102,6 @@ class MealieConfigFlow(ConfigFlow, domain=DOMAIN): user_input[CONF_API_TOKEN], ) if not errors: - assert self.entry if self.entry.unique_id == user_id: return self.async_update_reload_and_abort( self.entry, @@ -122,7 +121,7 @@ class MealieConfigFlow(ConfigFlow, domain=DOMAIN): self, entry_data: Mapping[str, Any] ) -> ConfigFlowResult: """Handle reconfiguration of the integration.""" - self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"]) + self.entry = self._get_reconfigure_entry() return await self.async_step_reconfigure_confirm() async def async_step_reconfigure_confirm( @@ -137,7 +136,6 @@ class MealieConfigFlow(ConfigFlow, domain=DOMAIN): user_input[CONF_API_TOKEN], ) if not errors: - assert self.entry if self.entry.unique_id == user_id: return self.async_update_reload_and_abort( self.entry,