Update roomba to use async_add_executor_job (#41448)
parent
4ab02cb9bc
commit
52e8366ce7
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue