Update a roborock blocking call to be fully async (#124266)

Remove a blocking call in roborock
This commit is contained in:
Allen Porter 2024-08-25 08:56:17 -07:00 committed by GitHub
parent d3293336b1
commit d18e81f932
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -168,7 +168,9 @@ async def setup_device_v1(
home_data_rooms: list[HomeDataRoom],
) -> RoborockDataUpdateCoordinator | None:
"""Set up a device Coordinator."""
mqtt_client = RoborockMqttClientV1(user_data, DeviceData(device, product_info.name))
mqtt_client = await hass.async_add_executor_job(
RoborockMqttClientV1, user_data, DeviceData(device, product_info.name)
)
try:
networking = await mqtt_client.get_networking()
if networking is None: