Add BTHome hold release event (#188847)

This commit is contained in:
Bascht74
2026-10-27 18:41:20 +00:00
committed by GitHub
parent 53c46ba177
commit 96bf6d6dfb
7 changed files with 23 additions and 2 deletions
@@ -43,6 +43,7 @@ EVENT_TYPES_BY_EVENT_CLASS = {
"long_double_press",
"long_triple_press",
"hold_press",
"hold_release",
},
EVENT_CLASS_DIMMER: {"rotate_left", "rotate_right"},
EVENT_CLASS_COMMAND: {"off", "on", "toggle", "step_up", "step_down"},
+1
View File
@@ -38,6 +38,7 @@ DESCRIPTIONS_BY_EVENT_CLASS = {
"long_double_press",
"long_triple_press",
"hold_press",
"hold_release",
],
device_class=EventDeviceClass.BUTTON,
),
@@ -22,5 +22,5 @@
"documentation": "https://www.home-assistant.io/integrations/bthome",
"iot_class": "local_push",
"loggers": ["bthome_ble"],
"requirements": ["bthome-ble==3.24.0"]
"requirements": ["bthome-ble==3.25.0"]
}
@@ -31,6 +31,7 @@
"trigger_subtype": {
"double_press": "Double Press",
"hold_press": "Hold Press",
"hold_release": "Hold Release",
"long_double_press": "Long Double Press",
"long_press": "Long Press",
"long_triple_press": "Long Triple Press",
@@ -63,6 +64,7 @@
"state": {
"double_press": "Double press",
"hold_press": "Hold press",
"hold_release": "Hold release",
"long_double_press": "Long double press",
"long_press": "Long press",
"long_triple_press": "Long triple press",
@@ -79,6 +81,7 @@
"state": {
"double_press": "[%key:component::bthome::entity::event::button::state_attributes::event_type::state::double_press%]",
"hold_press": "[%key:component::bthome::entity::event::button::state_attributes::event_type::state::hold_press%]",
"hold_release": "[%key:component::bthome::entity::event::button::state_attributes::event_type::state::hold_release%]",
"long_double_press": "[%key:component::bthome::entity::event::button::state_attributes::event_type::state::long_double_press%]",
"long_press": "[%key:component::bthome::entity::event::button::state_attributes::event_type::state::long_press%]",
"long_triple_press": "[%key:component::bthome::entity::event::button::state_attributes::event_type::state::long_triple_press%]",
+1 -1
View File
@@ -771,7 +771,7 @@ brottsplatskartan==1.0.5
brunt==1.2.0
# homeassistant.components.bthome
bthome-ble==3.24.0
bthome-ble==3.25.0
# homeassistant.components.bt_home_hub_5
bthomehub5-devicelist==0.1.1
@@ -187,6 +187,7 @@ async def test_get_triggers_multiple_buttons(
[
("button_1", "long_press", STATE_ON),
("button_2", "press", STATE_ON),
("button_1", "hold_release", STATE_ON),
("button_3", "long_press", STATE_UNAVAILABLE),
("button", "long_press", STATE_UNAVAILABLE),
("button_1", "invalid_press", STATE_UNAVAILABLE),
+15
View File
@@ -53,6 +53,21 @@ from . import make_bthome_v2_adv
}
],
),
(
"A4:C1:38:8D:18:B2",
make_bthome_v2_adv(
"A4:C1:38:8D:18:B2",
b"\x40\x3a\x81",
),
None,
[
{
"entity": "event.test_device_18b2_button",
ATTR_FRIENDLY_NAME: "Test Device 18B2 Button",
ATTR_EVENT_TYPE: "hold_release",
}
],
),
(
"A4:C1:38:8D:18:B2",
make_bthome_v2_adv(