diff --git a/homeassistant/components/shelly/coordinator.py b/homeassistant/components/shelly/coordinator.py index 9177d390c91..1de02f56a07 100644 --- a/homeassistant/components/shelly/coordinator.py +++ b/homeassistant/components/shelly/coordinator.py @@ -8,6 +8,7 @@ from datetime import timedelta from typing import Any, cast import aioshelly +from aioshelly.ble import async_stop_scanner from aioshelly.block_device import BlockDevice from aioshelly.exceptions import DeviceConnectionError, InvalidAuthError, RpcCallError from aioshelly.rpc_device import RpcDevice, UpdateType @@ -516,6 +517,7 @@ class ShellyRpcCoordinator(DataUpdateCoordinator): CONF_BLE_SCANNER_MODE, BLEScannerMode.DISABLED ) if ble_scanner_mode == BLEScannerMode.DISABLED: + await async_stop_scanner(self.device) return if AwesomeVersion(self.device.version) < BLE_MIN_VERSION: LOGGER.error( @@ -562,6 +564,7 @@ class ShellyRpcCoordinator(DataUpdateCoordinator): async def shutdown(self) -> None: """Shutdown the coordinator.""" + await async_stop_scanner(self.device) await self.device.shutdown() await self._async_disconnected() diff --git a/homeassistant/components/shelly/manifest.json b/homeassistant/components/shelly/manifest.json index ce32dbcc41a..aea453127fd 100644 --- a/homeassistant/components/shelly/manifest.json +++ b/homeassistant/components/shelly/manifest.json @@ -3,7 +3,7 @@ "name": "Shelly", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/shelly", - "requirements": ["aioshelly==5.0.0"], + "requirements": ["aioshelly==5.1.0"], "dependencies": ["bluetooth", "http"], "zeroconf": [ { diff --git a/requirements_all.txt b/requirements_all.txt index fb185bead9b..75181ecaf4e 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -261,7 +261,7 @@ aiosenseme==0.6.1 aiosenz==1.0.0 # homeassistant.components.shelly -aioshelly==5.0.0 +aioshelly==5.1.0 # homeassistant.components.skybell aioskybell==22.7.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index c3654ae0d94..70ed2b28bc5 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -236,7 +236,7 @@ aiosenseme==0.6.1 aiosenz==1.0.0 # homeassistant.components.shelly -aioshelly==5.0.0 +aioshelly==5.1.0 # homeassistant.components.skybell aioskybell==22.7.0