diff --git a/homeassistant/components/shelly/coordinator.py b/homeassistant/components/shelly/coordinator.py index 1de02f56a07..11bdf933037 100644 --- a/homeassistant/components/shelly/coordinator.py +++ b/homeassistant/components/shelly/coordinator.py @@ -8,7 +8,7 @@ from datetime import timedelta from typing import Any, cast import aioshelly -from aioshelly.ble import async_stop_scanner +from aioshelly.ble import async_ensure_ble_enabled, async_stop_scanner from aioshelly.block_device import BlockDevice from aioshelly.exceptions import DeviceConnectionError, InvalidAuthError, RpcCallError from aioshelly.rpc_device import RpcDevice, UpdateType @@ -527,6 +527,10 @@ class ShellyRpcCoordinator(DataUpdateCoordinator): BLE_MIN_VERSION, ) return + if await async_ensure_ble_enabled(self.device): + # BLE enable required a reboot, don't bother connecting + # the scanner since it will be disconnected anyway + return self._disconnected_callbacks.append( await async_connect_scanner(self.hass, self, ble_scanner_mode) )