From e161bb9e414e0fa342a6c82cea75676594fe988d Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Fri, 24 Nov 2023 19:56:15 +0100 Subject: [PATCH] fix BLE stop error for disconnected Shelly devices (#104457) --- homeassistant/components/shelly/coordinator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/shelly/coordinator.py b/homeassistant/components/shelly/coordinator.py index b618656313d..d1f9d6943bf 100644 --- a/homeassistant/components/shelly/coordinator.py +++ b/homeassistant/components/shelly/coordinator.py @@ -584,7 +584,7 @@ class ShellyRpcCoordinator(ShellyCoordinatorBase[RpcDevice]): ble_scanner_mode = self.entry.options.get( CONF_BLE_SCANNER_MODE, BLEScannerMode.DISABLED ) - if ble_scanner_mode == BLEScannerMode.DISABLED: + if ble_scanner_mode == BLEScannerMode.DISABLED and self.connected: await async_stop_scanner(self.device) return if AwesomeVersion(self.device.version) < BLE_MIN_VERSION: