Add events to BTHome (#91691)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Ernst Klamer 2023-04-22 21:10:27 +02:00 committed by GitHub
parent ca76285bcf
commit 328b79a4af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 529 additions and 5 deletions

View file

@ -1,3 +1,32 @@
"""Constants for the BTHome Bluetooth integration."""
from __future__ import annotations
from typing import Final, TypedDict
DOMAIN = "bthome"
CONF_BINDKEY: Final = "bindkey"
CONF_DISCOVERED_EVENT_CLASSES: Final = "known_events"
CONF_SUBTYPE: Final = "subtype"
EVENT_TYPE: Final = "event_type"
EVENT_CLASS: Final = "event_class"
EVENT_PROPERTIES: Final = "event_properties"
BTHOME_BLE_EVENT: Final = "bthome_ble_event"
EVENT_CLASS_BUTTON: Final = "button"
EVENT_CLASS_DIMMER: Final = "dimmer"
CONF_EVENT_CLASS: Final = "event_class"
CONF_EVENT_PROPERTIES: Final = "event_properties"
class BTHomeBleEvent(TypedDict):
"""BTHome BLE event data."""
device_id: str
address: str
event_class: str # ie 'button'
event_type: str # ie 'press'
event_properties: dict[str, str | int | float | None] | None