Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """Constants for the Xiaomi Bluetooth integration."""
2 
3 from __future__ import annotations
4 
5 from typing import Final, TypedDict
6 
7 DOMAIN = "xiaomi_ble"
8 
9 
10 CONF_DISCOVERED_EVENT_CLASSES: Final = "known_events"
11 CONF_EVENT_PROPERTIES: Final = "event_properties"
12 CONF_EVENT_CLASS: Final = "event_class"
13 CONF_SLEEPY_DEVICE: Final = "sleepy_device"
14 CONF_SUBTYPE: Final = "subtype"
15 
16 EVENT_CLASS: Final = "event_class"
17 EVENT_TYPE: Final = "event_type"
18 EVENT_SUBTYPE: Final = "event_subtype"
19 EVENT_PROPERTIES: Final = "event_properties"
20 XIAOMI_BLE_EVENT: Final = "xiaomi_ble_event"
21 
22 EVENT_CLASS_BUTTON: Final = "button"
23 EVENT_CLASS_CUBE: Final = "cube"
24 EVENT_CLASS_DIMMER: Final = "dimmer"
25 EVENT_CLASS_ERROR: Final = "error"
26 EVENT_CLASS_FINGERPRINT: Final = "fingerprint"
27 EVENT_CLASS_LOCK: Final = "lock"
28 EVENT_CLASS_MOTION: Final = "motion"
29 
30 BUTTON: Final = "button"
31 CUBE: Final = "cube"
32 DIMMER: Final = "dimmer"
33 ERROR: Final = "error"
34 FINGERPRINT: Final = "fingerprint"
35 LOCK: Final = "lock"
36 LOCK_FINGERPRINT = "lock_fingerprint"
37 MOTION_DEVICE: Final = "motion_device"
38 DOUBLE_BUTTON: Final = "double_button"
39 TRIPPLE_BUTTON: Final = "tripple_button"
40 REMOTE: Final = "remote"
41 REMOTE_FAN: Final = "remote_fan"
42 REMOTE_VENFAN: Final = "remote_ventilator_fan"
43 REMOTE_BATHROOM: Final = "remote_bathroom"
44 MOTION: Final = "motion"
45 
46 BUTTON_PRESS: Final = "button_press"
47 BUTTON_PRESS_LONG: Final = "button_press_long"
48 BUTTON_PRESS_DOUBLE_LONG: Final = "button_press_double_long"
49 DOUBLE_BUTTON_PRESS_DOUBLE_LONG: Final = "double_button_press_double_long"
50 TRIPPLE_BUTTON_PRESS_DOUBLE_LONG: Final = "tripple_button_press_double_long"
51 
52 
53 class XiaomiBleEvent(TypedDict):
54  """Xiaomi BLE event data."""
55 
56  device_id: str
57  address: str
58  event_class: str # ie 'button'
59  event_type: str # ie 'press'
60  event_properties: dict[str, str | int | float | None] | None