1 """The BTHome Bluetooth integration."""
3 from collections.abc
import Callable
4 from logging
import Logger
6 from bthome_ble
import BTHomeBluetoothDeviceData, SensorUpdate
10 BluetoothServiceInfoBleak,
13 PassiveBluetoothDataProcessor,
14 PassiveBluetoothProcessorCoordinator,
18 from .const
import CONF_SLEEPY_DEVICE
19 from .types
import BTHomeConfigEntry
23 PassiveBluetoothProcessorCoordinator[SensorUpdate]
25 """Define a BTHome Bluetooth Passive Update Processor Coordinator."""
32 mode: BluetoothScanningMode,
33 update_method: Callable[[BluetoothServiceInfoBleak], SensorUpdate],
34 device_data: BTHomeBluetoothDeviceData,
35 discovered_event_classes: set[str],
36 entry: BTHomeConfigEntry,
37 connectable: bool =
False,
39 """Initialize the BTHome Bluetooth Passive Update Processor Coordinator."""
40 super().
__init__(hass, logger, address, mode, update_method, connectable)
47 """Return True if the device is a sleepy device."""
48 return self.
entryentry.data.get(CONF_SLEEPY_DEVICE, self.
device_datadevice_data.sleepy_device)
52 PassiveBluetoothDataProcessor[_T, SensorUpdate]
54 """Define a BTHome Bluetooth Passive Update Data Processor."""
56 coordinator: BTHomePassiveBluetoothProcessorCoordinator
None __init__(self, HomeAssistant hass, Logger logger, str address, BluetoothScanningMode mode, Callable[[BluetoothServiceInfoBleak], SensorUpdate] update_method, BTHomeBluetoothDeviceData device_data, set[str] discovered_event_classes, BTHomeConfigEntry entry, bool connectable=False)