Lovelace: add confirmation action (#10834)

* Lovelace: add confirmation action

* add default

* Update lovelace_navigation.html
This commit is contained in:
Ian Richardson 2019-10-20 09:07:26 -05:00 committed by Franck Nijhof
parent 18d53ec9cb
commit 6882906805
6 changed files with 288 additions and 0 deletions

View File

@ -80,6 +80,11 @@ tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
hold_action:
required: false
description: Action to take on tap-and-hold
@ -110,6 +115,11 @@ hold_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
double_tap_action:
required: false
description: Action to take on double tap
@ -140,12 +150,40 @@ double_tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
theme:
required: false
description: "Set to any theme within `themes.yaml`"
type: string
{% endconfiguration %}
## Options For Confirmation
If you define confirmation as an object instead of boolean, you can add more customization and configurations:
{% configuration %}
text:
required: false
description: Text to present in the confirmation dialog.
type: string
exemptions:
required: false
description: "List of `exemption` objects. See below"
type: list
{% endconfiguration %}
## Options For Exemptions
{% configuration badges %}
user:
required: true
description: User id that can see the view tab.
type: string
{% endconfiguration %}
## Examples
Title and Script Service Example:

View File

@ -105,6 +105,11 @@ tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
hold_action:
required: false
description: Action to take on tap-and-hold
@ -135,6 +140,11 @@ hold_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
double_tap_action:
required: false
description: Action to take on double tap
@ -165,6 +175,34 @@ double_tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
{% endconfiguration %}
## Options For Confirmation
If you define confirmation as an object instead of boolean, you can add more customization and configurations:
{% configuration %}
text:
required: false
description: Text to present in the confirmation dialog.
type: string
exemptions:
required: false
description: "List of `exemption` objects. See below"
type: list
{% endconfiguration %}
## Options For Exemptions
{% configuration badges %}
user:
required: true
description: User id that can see the view tab.
type: string
{% endconfiguration %}
## Examples

View File

@ -109,6 +109,11 @@ tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
hold_action:
required: false
description: Action to take on tap-and-hold
@ -139,6 +144,11 @@ hold_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
double_tap_action:
required: false
description: Action to take on double tap
@ -169,6 +179,11 @@ double_tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
style:
required: true
description: Position and style the element using CSS.
@ -229,6 +244,11 @@ tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
hold_action:
required: false
description: Action to take on tap-and-hold
@ -259,6 +279,11 @@ hold_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
double_tap_action:
required: false
description: Action to take on double tap
@ -289,6 +314,11 @@ double_tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
style:
required: true
description: Position and style the element using CSS.
@ -371,6 +401,11 @@ tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
hold_action:
required: false
description: Action to take on tap-and-hold
@ -401,6 +436,11 @@ hold_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
double_tap_action:
required: false
description: Action to take on double tap
@ -431,6 +471,11 @@ double_tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
style:
required: true
description: Position and style the element using CSS.
@ -483,6 +528,11 @@ tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
hold_action:
required: false
description: Action to take on tap-and-hold
@ -513,6 +563,11 @@ hold_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
double_tap_action:
required: false
description: Action to take on double tap
@ -543,6 +598,11 @@ double_tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
image:
required: false
description: The image to display.
@ -612,6 +672,29 @@ elements:
type: list
{% endconfiguration %}
## Options For Confirmation
If you define confirmation as an object instead of boolean, you can add more customization and configurations:
{% configuration %}
text:
required: false
description: Text to present in the confirmation dialog.
type: string
exemptions:
required: false
description: "List of `exemption` objects. See below"
type: list
{% endconfiguration %}
## Options For Exemptions
{% configuration badges %}
user:
required: true
description: User id that can see the view tab.
type: string
{% endconfiguration %}
### Custom Elements
{% configuration %}

View File

@ -89,6 +89,11 @@ tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
hold_action:
required: false
description: Action to take on tap-and-hold
@ -119,6 +124,11 @@ hold_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
double_tap_action:
required: false
description: Action to take on double tap
@ -149,6 +159,34 @@ double_tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
{% endconfiguration %}
## Options For Confirmation
If you define confirmation as an object instead of boolean, you can add more customization and configurations:
{% configuration %}
text:
required: false
description: Text to present in the confirmation dialog.
type: string
exemptions:
required: false
description: "List of `exemption` objects. See below"
type: list
{% endconfiguration %}
## Options For Exemptions
{% configuration badges %}
user:
required: true
description: User id that can see the view tab.
type: string
{% endconfiguration %}
## How to use state_filter

View File

@ -88,6 +88,11 @@ tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
hold_action:
required: false
description: Action to take on tap-and-hold
@ -118,6 +123,11 @@ hold_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
double_tap_action:
required: false
description: Action to take on double tap
@ -148,6 +158,11 @@ double_tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
{% endconfiguration %}
## Options For Entities
@ -188,6 +203,11 @@ tap_action:
description: "Service data to include (e.g., `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
hold_action:
required: false
description: Action to take on tap-and-hold
@ -213,6 +233,11 @@ hold_action:
description: "Service data to include (e.g., `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
double_tap_action:
required: false
description: Action to take on double tap
@ -243,6 +268,34 @@ double_tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
{% endconfiguration %}
## Options For Confirmation
If you define confirmation as an object instead of boolean, you can add more customization and configurations:
{% configuration %}
text:
required: false
description: Text to present in the confirmation dialog.
type: string
exemptions:
required: false
description: "List of `exemption` objects. See below"
type: list
{% endconfiguration %}
## Options For Exemptions
{% configuration badges %}
user:
required: true
description: User id that can see the view tab.
type: string
{% endconfiguration %}
## How to use state_filter

View File

@ -50,6 +50,11 @@ tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
hold_action:
required: false
description: Action to take on tap-and-hold
@ -80,6 +85,11 @@ hold_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
double_tap_action:
required: false
description: Action to take on double tap
@ -110,6 +120,34 @@ double_tap_action:
description: "Service data to include (e.g. `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
confirmation:
required: false
description: "Present a confirmation dialog to confirm the action. See `confirmation` object below"
type: [boolean, map]
default: "false"
{% endconfiguration %}
## Options For Confirmation
If you define confirmation as an object instead of boolean, you can add more customization and configurations:
{% configuration %}
text:
required: false
description: Text to present in the confirmation dialog.
type: string
exemptions:
required: false
description: "List of `exemption` objects. See below"
type: list
{% endconfiguration %}
## Options For Exemptions
{% configuration badges %}
user:
required: true
description: User id that can see the view tab.
type: string
{% endconfiguration %}
## Examples