diff --git a/homeassistant/components/lutron/event.py b/homeassistant/components/lutron/event.py index b9b086eb0bd2..c7c889b420be 100644 --- a/homeassistant/components/lutron/event.py +++ b/homeassistant/components/lutron/event.py @@ -94,7 +94,8 @@ class LutronEventEntity(LutronKeypad, EventEntity): action = LutronEventType.PRESS else: action = LutronEventType.RELEASE - elif event == Button.Event.PRESSED: + elif event in (Button.Event.PRESSED, Button.Event.RELEASED): + # Buttons carrying a hold action report only a release, never a press. action = LutronEventType.SINGLE_PRESS if action: diff --git a/tests/components/lutron/test_event.py b/tests/components/lutron/test_event.py index 856b17a2077d..3120a576d965 100644 --- a/tests/components/lutron/test_event.py +++ b/tests/components/lutron/test_event.py @@ -93,3 +93,24 @@ async def test_event_press_release( assert len(events) == 2 assert events[1].data["action"] == "released" + + +async def test_event_release_only_button( + hass: HomeAssistant, mock_lutron: MagicMock, mock_config_entry: MockConfigEntry +) -> None: + """A button that only ever reports a release still fires a single press.""" + mock_config_entry.add_to_hass(hass) + + button = mock_lutron.areas[0].keypads[0].buttons[0] + await hass.config_entries.async_setup(mock_config_entry.entry_id) + await hass.async_block_till_done() + + events = async_capture_events(hass, "lutron_event") + + for call in button.subscribe.call_args_list: + callback = call[0][0] + callback(button, None, Button.Event.RELEASED, None) + await hass.async_block_till_done() + + assert len(events) == 1 + assert events[0].data["action"] == "single"