From 320aa34d39819e3b7302ae4fc9f711a7ac167bc1 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Mon, 28 Oct 2024 08:37:38 +0100 Subject: [PATCH] Use async_start_reauth in xiaomi_miio (#129282) * Use async_start_reauth in xiaomi_miio * Apply suggestions from code review Co-authored-by: Teemu R. --------- Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> Co-authored-by: Teemu R. --- homeassistant/components/xiaomi_miio/config_flow.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/homeassistant/components/xiaomi_miio/config_flow.py b/homeassistant/components/xiaomi_miio/config_flow.py index bd925b5fc54..7fc84c26235 100644 --- a/homeassistant/components/xiaomi_miio/config_flow.py +++ b/homeassistant/components/xiaomi_miio/config_flow.py @@ -13,7 +13,6 @@ import voluptuous as vol from homeassistant.components import zeroconf from homeassistant.config_entries import ( - SOURCE_REAUTH, ConfigEntry, ConfigFlow, ConfigFlowResult, @@ -83,14 +82,7 @@ class OptionsFlowHandler(OptionsFlow): not cloud_username or not cloud_password or not cloud_country ): errors["base"] = "cloud_credentials_incomplete" - # trigger re-auth flow - self.hass.async_create_task( - self.hass.config_entries.flow.async_init( - DOMAIN, - context={"source": SOURCE_REAUTH}, - data=self.config_entry.data, - ) - ) + self.config_entry.async_start_reauth(self.hass) if not errors: return self.async_create_entry(title="", data=user_input)