Add support for `triple_push` event for Shelly gen2 devices (#88081)
* Add support for triple_push event * Sort * Fix testspull/88163/head
parent
50cbabb2d8
commit
cd4ce86f07
|
@ -102,6 +102,7 @@ RPC_INPUTS_EVENTS_TYPES: Final = {
|
|||
"btn_up",
|
||||
"single_push",
|
||||
"double_push",
|
||||
"triple_push",
|
||||
"long_push",
|
||||
}
|
||||
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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"}})
|
||||
|
|
Loading…
Reference in New Issue