Relocate base Bluetooth scanner code into an external library (#104930)
This commit is contained in:
parent
c8bb72935d
commit
28584ad240
14 changed files with 51 additions and 460 deletions
|
@ -2,11 +2,9 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Callable
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
from typing import TYPE_CHECKING, Final
|
||||
|
||||
from bleak import BaseBleakClient
|
||||
from bluetooth_data_tools import monotonic_time_coarse
|
||||
from home_assistant_bluetooth import BluetoothServiceInfoBleak
|
||||
|
||||
|
@ -19,15 +17,6 @@ MANAGER: BluetoothManager | None = None
|
|||
MONOTONIC_TIME: Final = monotonic_time_coarse
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class HaBluetoothConnector:
|
||||
"""Data for how to connect a BLEDevice from a given scanner."""
|
||||
|
||||
client: type[BaseBleakClient]
|
||||
source: str
|
||||
can_connect: Callable[[], bool]
|
||||
|
||||
|
||||
class BluetoothScanningMode(Enum):
|
||||
"""The mode of scanning for bluetooth devices."""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue