fix BLE stop error for disconnected Shelly devices (#104457)

This commit is contained in:
Simone Chemelli
2023-11-24 19:56:15 +01:00
committed by GitHub
parent 2515dbeee1
commit e161bb9e41

View File

@@ -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: