mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 23:27:37 +00:00
Add support for triple_push
event for Shelly gen2 devices (#88081)
* Add support for triple_push event * Sort * Fix tests
This commit is contained in:
parent
50cbabb2d8
commit
cd4ce86f07
@ -102,6 +102,7 @@ RPC_INPUTS_EVENTS_TYPES: Final = {
|
|||||||
"btn_up",
|
"btn_up",
|
||||||
"single_push",
|
"single_push",
|
||||||
"double_push",
|
"double_push",
|
||||||
|
"triple_push",
|
||||||
"long_push",
|
"long_push",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
"btn_up": "{subtype} button up",
|
"btn_up": "{subtype} button up",
|
||||||
"single_push": "{subtype} single push",
|
"single_push": "{subtype} single push",
|
||||||
"double_push": "{subtype} double push",
|
"double_push": "{subtype} double push",
|
||||||
|
"triple_push": "{subtype} triple push",
|
||||||
"long_push": "{subtype} long push"
|
"long_push": "{subtype} long push"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -91,7 +91,14 @@ async def test_get_triggers_rpc_device(hass, mock_rpc_device):
|
|||||||
CONF_SUBTYPE: "button1",
|
CONF_SUBTYPE: "button1",
|
||||||
"metadata": {},
|
"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(
|
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."""
|
"""Test get RPC input triggers."""
|
||||||
monkeypatch.setattr(mock_rpc_device, "config", {"input:0": {"type": "button"}})
|
monkeypatch.setattr(mock_rpc_device, "config", {"input:0": {"type": "button"}})
|
||||||
assert set(get_rpc_input_triggers(mock_rpc_device)) == {
|
assert set(get_rpc_input_triggers(mock_rpc_device)) == {
|
||||||
("long_push", "button1"),
|
|
||||||
("single_push", "button1"),
|
|
||||||
("btn_down", "button1"),
|
("btn_down", "button1"),
|
||||||
("double_push", "button1"),
|
|
||||||
("btn_up", "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"}})
|
monkeypatch.setattr(mock_rpc_device, "config", {"input:0": {"type": "switch"}})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user