From a7b5e4323e75f28f868b7f04560da0406f4b3b41 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Fri, 18 Oct 2024 08:46:49 +0200 Subject: [PATCH] Use reauth helpers in honeywell (#128629) --- homeassistant/components/honeywell/config_flow.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/honeywell/config_flow.py b/homeassistant/components/honeywell/config_flow.py index 7f298aee632..c9b1dfb950a 100644 --- a/homeassistant/components/honeywell/config_flow.py +++ b/homeassistant/components/honeywell/config_flow.py @@ -38,14 +38,11 @@ class HoneywellConfigFlow(ConfigFlow, domain=DOMAIN): """Handle a honeywell config flow.""" VERSION = 1 - entry: ConfigEntry | None async def async_step_reauth( self, entry_data: Mapping[str, Any] ) -> ConfigFlowResult: """Handle re-authentication with Honeywell.""" - - self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"]) return await self.async_step_reauth_confirm() async def async_step_reauth_confirm( @@ -53,8 +50,8 @@ class HoneywellConfigFlow(ConfigFlow, domain=DOMAIN): ) -> ConfigFlowResult: """Confirm re-authentication with Honeywell.""" errors: dict[str, str] = {} - assert self.entry is not None + reauth_entry = self._get_reauth_entry() if user_input: try: await self.is_valid( @@ -72,18 +69,14 @@ class HoneywellConfigFlow(ConfigFlow, domain=DOMAIN): errors["base"] = "cannot_connect" else: return self.async_update_reload_and_abort( - self.entry, - data={ - **self.entry.data, - **user_input, - }, + reauth_entry, + data_updates=user_input, ) return self.async_show_form( step_id="reauth_confirm", data_schema=self.add_suggested_values_to_schema( - REAUTH_SCHEMA, - self.entry.data, + REAUTH_SCHEMA, reauth_entry.data ), errors=errors, description_placeholders={"name": "Honeywell"},