Fix blocking call in Xiaomi Miio integration (#126871)

pull/126402/head
Manu 2024-09-27 13:11:28 +02:00 committed by GitHub
parent 1d49c5056c
commit b78a1f7b61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -237,7 +237,9 @@ class XiaomiMiioFlowHandler(ConfigFlow, domain=DOMAIN):
step_id="cloud", data_schema=DEVICE_CLOUD_CONFIG, errors=errors
)
miio_cloud = MiCloud(cloud_username, cloud_password)
miio_cloud = await self.hass.async_add_executor_job(
MiCloud, cloud_username, cloud_password
)
try:
if not await self.hass.async_add_executor_job(miio_cloud.login):
errors["base"] = "cloud_login_error"