Stop shelly BLE scanner on unload (#82151)

* Stop shelly BLE scanner on unload

needs https://github.com/home-assistant-libs/aioshelly/pull/285

* bump
This commit is contained in:
J. Nick Koston 2022-11-15 15:22:33 -06:00 committed by GitHub
parent a2e638329e
commit 7614aba401
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 3 deletions

View File

@ -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()

View File

@ -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": [
{

View File

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

View File

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