mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 15:47:12 +00:00
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:
parent
a2e638329e
commit
7614aba401
@ -8,6 +8,7 @@ from datetime import timedelta
|
|||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
|
|
||||||
import aioshelly
|
import aioshelly
|
||||||
|
from aioshelly.ble import async_stop_scanner
|
||||||
from aioshelly.block_device import BlockDevice
|
from aioshelly.block_device import BlockDevice
|
||||||
from aioshelly.exceptions import DeviceConnectionError, InvalidAuthError, RpcCallError
|
from aioshelly.exceptions import DeviceConnectionError, InvalidAuthError, RpcCallError
|
||||||
from aioshelly.rpc_device import RpcDevice, UpdateType
|
from aioshelly.rpc_device import RpcDevice, UpdateType
|
||||||
@ -516,6 +517,7 @@ class ShellyRpcCoordinator(DataUpdateCoordinator):
|
|||||||
CONF_BLE_SCANNER_MODE, BLEScannerMode.DISABLED
|
CONF_BLE_SCANNER_MODE, BLEScannerMode.DISABLED
|
||||||
)
|
)
|
||||||
if ble_scanner_mode == BLEScannerMode.DISABLED:
|
if ble_scanner_mode == BLEScannerMode.DISABLED:
|
||||||
|
await async_stop_scanner(self.device)
|
||||||
return
|
return
|
||||||
if AwesomeVersion(self.device.version) < BLE_MIN_VERSION:
|
if AwesomeVersion(self.device.version) < BLE_MIN_VERSION:
|
||||||
LOGGER.error(
|
LOGGER.error(
|
||||||
@ -562,6 +564,7 @@ class ShellyRpcCoordinator(DataUpdateCoordinator):
|
|||||||
|
|
||||||
async def shutdown(self) -> None:
|
async def shutdown(self) -> None:
|
||||||
"""Shutdown the coordinator."""
|
"""Shutdown the coordinator."""
|
||||||
|
await async_stop_scanner(self.device)
|
||||||
await self.device.shutdown()
|
await self.device.shutdown()
|
||||||
await self._async_disconnected()
|
await self._async_disconnected()
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "Shelly",
|
"name": "Shelly",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/shelly",
|
"documentation": "https://www.home-assistant.io/integrations/shelly",
|
||||||
"requirements": ["aioshelly==5.0.0"],
|
"requirements": ["aioshelly==5.1.0"],
|
||||||
"dependencies": ["bluetooth", "http"],
|
"dependencies": ["bluetooth", "http"],
|
||||||
"zeroconf": [
|
"zeroconf": [
|
||||||
{
|
{
|
||||||
|
@ -261,7 +261,7 @@ aiosenseme==0.6.1
|
|||||||
aiosenz==1.0.0
|
aiosenz==1.0.0
|
||||||
|
|
||||||
# homeassistant.components.shelly
|
# homeassistant.components.shelly
|
||||||
aioshelly==5.0.0
|
aioshelly==5.1.0
|
||||||
|
|
||||||
# homeassistant.components.skybell
|
# homeassistant.components.skybell
|
||||||
aioskybell==22.7.0
|
aioskybell==22.7.0
|
||||||
|
@ -236,7 +236,7 @@ aiosenseme==0.6.1
|
|||||||
aiosenz==1.0.0
|
aiosenz==1.0.0
|
||||||
|
|
||||||
# homeassistant.components.shelly
|
# homeassistant.components.shelly
|
||||||
aioshelly==5.0.0
|
aioshelly==5.1.0
|
||||||
|
|
||||||
# homeassistant.components.skybell
|
# homeassistant.components.skybell
|
||||||
aioskybell==22.7.0
|
aioskybell==22.7.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user