Update Actions.md

Additional example and amended example.
This commit is contained in:
Philip Abbey
2026-02-06 10:15:39 +00:00
parent e40e9280eb
commit 188fb8feff

View File

@@ -3,7 +3,7 @@
# Actions # Actions
A simple example using a scene as a `tap` menu item. Two simple examples using a scene and a cover as `tap` menu items.
```json ```json
{ {
@@ -14,6 +14,16 @@ A simple example using a scene as a `tap` menu item.
"action": "scene.turn_on" "action": "scene.turn_on"
} }
}, },
{
"entity":"cover.patio_shutter",
"name":"Patio Door Shutter",
"type":"tap",
"content":"{{state_translated('cover.patio_shutter')}} - {{state_attr('cover.patio_shutter', 'current_position')}}",
"tap_action":{
"action":"cover.toggle",
"confirm":true
}
}
``` ```
Any menu item with an action (`tap`, `template`, or `toggle`), may have a confirmation view added. For consistency this is always done via the `tap_action` JSON object, even though for a `toggle` menu item there will only ever be a single field inside. For the `toggle` menu item, the confirmation is presented on both `on` and `off` directions. There is no option for asymmetry, i.e. only in one direction. Any menu item with an action (`tap`, `template`, or `toggle`), may have a confirmation view added. For consistency this is always done via the `tap_action` JSON object, even though for a `toggle` menu item there will only ever be a single field inside. For the `toggle` menu item, the confirmation is presented on both `on` and `off` directions. There is no option for asymmetry, i.e. only in one direction.
@@ -30,8 +40,8 @@ For example:
```json ```json
{ {
"entity": "switch.garage_door", "entity": "switch.flood_lights",
"name": "Garage Door", "name": "Flood Lights",
"type": "toggle", "type": "toggle",
"tap_action": { "tap_action": {
"confirm": true "confirm": true