Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions homeassistant/components/shelly/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"btn_up",
"single_push",
"double_push",
"triple_push",
"long_push",
}

Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/shelly/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"btn_up": "{subtype} button up",
"single_push": "{subtype} single push",
"double_push": "{subtype} double push",
"triple_push": "{subtype} triple push",
"long_push": "{subtype} long push"
}
},
Expand Down
9 changes: 8 additions & 1 deletion tests/components/shelly/test_device_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,14 @@ async def test_get_triggers_rpc_device(hass, mock_rpc_device):
CONF_SUBTYPE: "button1",
"metadata": {},
}
for type in ["btn_down", "btn_up", "single_push", "double_push", "long_push"]
for type in [
"btn_down",
"btn_up",
"single_push",
"double_push",
"triple_push",
"long_push",
]
]

triggers = await async_get_device_automations(
Expand Down
7 changes: 4 additions & 3 deletions tests/components/shelly/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,12 @@ async def test_get_rpc_input_triggers(mock_rpc_device, monkeypatch):
"""Test get RPC input triggers."""
monkeypatch.setattr(mock_rpc_device, "config", {"input:0": {"type": "button"}})
assert set(get_rpc_input_triggers(mock_rpc_device)) == {
("long_push", "button1"),
("single_push", "button1"),
("btn_down", "button1"),
("double_push", "button1"),
("btn_up", "button1"),
("single_push", "button1"),
("double_push", "button1"),
("triple_push", "button1"),
("long_push", "button1"),
}

monkeypatch.setattr(mock_rpc_device, "config", {"input:0": {"type": "switch"}})
Expand Down