Fix long press event for matter generic switch (#99645)

This commit is contained in:
itpeters 2023-09-05 05:10:14 -06:00 committed by GitHub
parent c77a0a8caa
commit 582eeea082
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -65,7 +65,7 @@ class MatterEventEntity(MatterEntity, EventEntity):
if feature_map & SwitchFeature.kMomentarySwitchRelease:
event_types.append("short_release")
if feature_map & SwitchFeature.kMomentarySwitchLongPress:
event_types.append("long_press_ongoing")
event_types.append("long_press")
event_types.append("long_release")
if feature_map & SwitchFeature.kMomentarySwitchMultiPress:
event_types.append("multi_press_ongoing")

View file

@ -48,7 +48,7 @@ async def test_generic_switch_node(
assert state.attributes[ATTR_EVENT_TYPES] == [
"initial_press",
"short_release",
"long_press_ongoing",
"long_press",
"long_release",
"multi_press_ongoing",
"multi_press_complete",
@ -111,7 +111,7 @@ async def test_generic_switch_multi_node(
assert state_button_1.attributes[ATTR_EVENT_TYPES] == [
"initial_press",
"short_release",
"long_press_ongoing",
"long_press",
"long_release",
]
# check button 2