diff --git a/homeassistant/components/mysensors/gateway.py b/homeassistant/components/mysensors/gateway.py index 635df264f75..1d016a791e3 100644 --- a/homeassistant/components/mysensors/gateway.py +++ b/homeassistant/components/mysensors/gateway.py @@ -116,7 +116,7 @@ async def try_connect( finally: if connect_task is not None and not connect_task.done(): connect_task.cancel() - asyncio.create_task(gateway.stop()) + await gateway.stop() except OSError as err: _LOGGER.info("Try gateway connect failed with exception", exc_info=err) return False