mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 17:57:55 +00:00
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. <tpr@iki.fi> --------- Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> Co-authored-by: Teemu R. <tpr@iki.fi>
This commit is contained in:
parent
87f2a4242e
commit
320aa34d39
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user