Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """Constants for the BTHome Bluetooth integration."""
2 
3 from __future__ import annotations
4 
5 from typing import Final, TypedDict
6 
7 DOMAIN = "bthome"
8 
9 CONF_BINDKEY: Final = "bindkey"
10 CONF_DISCOVERED_EVENT_CLASSES: Final = "known_events"
11 CONF_SLEEPY_DEVICE: Final = "sleepy_device"
12 CONF_SUBTYPE: Final = "subtype"
13 
14 EVENT_TYPE: Final = "event_type"
15 EVENT_CLASS: Final = "event_class"
16 EVENT_PROPERTIES: Final = "event_properties"
17 BTHOME_BLE_EVENT: Final = "bthome_ble_event"
18 
19 
20 EVENT_CLASS_BUTTON: Final = "button"
21 EVENT_CLASS_DIMMER: Final = "dimmer"
22 
23 CONF_EVENT_CLASS: Final = "event_class"
24 CONF_EVENT_PROPERTIES: Final = "event_properties"
25 
26 
27 class BTHomeBleEvent(TypedDict):
28  """BTHome BLE event data."""
29 
30  device_id: str
31  address: str
32  event_class: str # ie 'button'
33  event_type: str # ie 'press'
34  event_properties: dict[str, str | int | float | None] | None