1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Refactor bluetooth scanners for better seperation of concerns (#104909)

This commit is contained in:
J. Nick Koston
2023-12-02 13:20:06 -10:00
committed by GitHub
parent 7a9c3819e0
commit dd9c22672a
12 changed files with 195 additions and 111 deletions

View File

@@ -10,9 +10,9 @@ from bleak.backends.scanner import AdvertisementData
import pytest
from homeassistant.components.bluetooth import (
BaseHaRemoteScanner,
BaseHaScanner,
HaBluetoothConnector,
HomeAssistantRemoteScanner,
)
from homeassistant.components.bluetooth.wrappers import (
HaBleakClientWrapper,
@@ -158,7 +158,7 @@ async def test_wrapped_bleak_client_set_disconnected_callback_after_connected(
local_name="wohand", service_uuids=[], manufacturer_data={1: b"\x01"}, rssi=-100
)
class FakeScanner(BaseHaRemoteScanner):
class FakeScanner(HomeAssistantRemoteScanner):
@property
def discovered_devices(self) -> list[BLEDevice]:
"""Return a list of discovered devices."""
@@ -271,7 +271,7 @@ async def test_ble_device_with_proxy_client_out_of_connections(
local_name="wohand", service_uuids=[], manufacturer_data={1: b"\x01"}
)
class FakeScanner(BaseHaRemoteScanner):
class FakeScanner(HomeAssistantRemoteScanner):
@property
def discovered_devices(self) -> list[BLEDevice]:
"""Return a list of discovered devices."""
@@ -336,7 +336,7 @@ async def test_ble_device_with_proxy_clear_cache(
local_name="wohand", service_uuids=[], manufacturer_data={1: b"\x01"}
)
class FakeScanner(BaseHaRemoteScanner):
class FakeScanner(HomeAssistantRemoteScanner):
@property
def discovered_devices(self) -> list[BLEDevice]:
"""Return a list of discovered devices."""
@@ -439,7 +439,7 @@ async def test_ble_device_with_proxy_client_out_of_connections_uses_best_availab
"esp32_no_connection_slot",
)
class FakeScanner(BaseHaRemoteScanner):
class FakeScanner(HomeAssistantRemoteScanner):
@property
def discovered_devices(self) -> list[BLEDevice]:
"""Return a list of discovered devices."""
@@ -553,7 +553,7 @@ async def test_ble_device_with_proxy_client_out_of_connections_uses_best_availab
"esp32_no_connection_slot",
)
class FakeScanner(BaseHaRemoteScanner):
class FakeScanner(HomeAssistantRemoteScanner):
@property
def discovered_devices(self) -> list[BLEDevice]:
"""Return a list of discovered devices."""