Update roomba to use async_add_executor_job (#41448)

pull/41450/head^2
J. Nick Koston 2020-10-08 02:15:47 -05:00 committed by GitHub
parent 4ab02cb9bc
commit 52e8366ce7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -129,7 +129,7 @@ async def async_connect_or_timeout(hass, roomba):
name = None
with async_timeout.timeout(10):
_LOGGER.debug("Initialize connection to vacuum")
await hass.async_add_job(roomba.connect)
await hass.async_add_executor_job(roomba.connect)
while not roomba.roomba_connected or name is None:
# Waiting for connection and check datas ready
name = roomba_reported_state(roomba).get("name", None)
@ -152,7 +152,7 @@ async def async_disconnect_or_timeout(hass, roomba):
"""Disconnect to vacuum."""
_LOGGER.debug("Disconnect vacuum")
with async_timeout.timeout(3):
await hass.async_add_job(roomba.disconnect)
await hass.async_add_executor_job(roomba.disconnect)
return True