mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Enable shelly BLE when the scanner is enabled if it is disabled (#82153)
Co-authored-by: Shay Levy <levyshay1@gmail.com>
This commit is contained in:
parent
7614aba401
commit
ae7272575a
@ -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)
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user