2022-07-08 23:55:31 +00:00
|
|
|
"""Models for bluetooth."""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
2022-08-17 00:52:53 +00:00
|
|
|
from collections.abc import Callable
|
|
|
|
from enum import Enum
|
2023-12-11 20:42:00 +00:00
|
|
|
from typing import TYPE_CHECKING
|
2022-07-08 23:55:31 +00:00
|
|
|
|
2022-11-15 20:00:52 +00:00
|
|
|
from home_assistant_bluetooth import BluetoothServiceInfoBleak
|
2022-07-08 23:55:31 +00:00
|
|
|
|
2022-08-01 15:54:06 +00:00
|
|
|
if TYPE_CHECKING:
|
2023-12-11 20:42:00 +00:00
|
|
|
from .manager import HomeAssistantBluetoothManager
|
2022-08-17 20:51:56 +00:00
|
|
|
|
2022-08-01 15:54:06 +00:00
|
|
|
|
2023-12-11 20:42:00 +00:00
|
|
|
MANAGER: HomeAssistantBluetoothManager | None = None
|
2022-11-13 20:18:36 +00:00
|
|
|
|
2022-07-08 23:55:31 +00:00
|
|
|
|
2022-11-20 14:44:28 +00:00
|
|
|
BluetoothChange = Enum("BluetoothChange", "ADVERTISEMENT")
|
|
|
|
BluetoothCallback = Callable[[BluetoothServiceInfoBleak, BluetoothChange], None]
|
|
|
|
ProcessAdvertisementCallback = Callable[[BluetoothServiceInfoBleak], bool]
|