From 6882906805a006fbff77402406960acb4f5427b7 Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Sun, 20 Oct 2019 09:07:26 -0500 Subject: [PATCH] Lovelace: add confirmation action (#10834) * Lovelace: add confirmation action * add default * Update lovelace_navigation.html --- source/_lovelace/entity-button.markdown | 38 ++++++++++ source/_lovelace/glance.markdown | 38 ++++++++++ source/_lovelace/picture-elements.markdown | 83 ++++++++++++++++++++++ source/_lovelace/picture-entity.markdown | 38 ++++++++++ source/_lovelace/picture-glance.markdown | 53 ++++++++++++++ source/_lovelace/picture.markdown | 38 ++++++++++ 6 files changed, 288 insertions(+) diff --git a/source/_lovelace/entity-button.markdown b/source/_lovelace/entity-button.markdown index f4fe761f98e..812c77eb185 100644 --- a/source/_lovelace/entity-button.markdown +++ b/source/_lovelace/entity-button.markdown @@ -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: diff --git a/source/_lovelace/glance.markdown b/source/_lovelace/glance.markdown index 946e4fca3b3..3efaa32bba7 100644 --- a/source/_lovelace/glance.markdown +++ b/source/_lovelace/glance.markdown @@ -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 diff --git a/source/_lovelace/picture-elements.markdown b/source/_lovelace/picture-elements.markdown index 2294ce9de23..62feacd31db 100644 --- a/source/_lovelace/picture-elements.markdown +++ b/source/_lovelace/picture-elements.markdown @@ -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 %} diff --git a/source/_lovelace/picture-entity.markdown b/source/_lovelace/picture-entity.markdown index b983899b5b3..3249ea78265 100644 --- a/source/_lovelace/picture-entity.markdown +++ b/source/_lovelace/picture-entity.markdown @@ -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 diff --git a/source/_lovelace/picture-glance.markdown b/source/_lovelace/picture-glance.markdown index e742d3d5544..2f5dee6b478 100644 --- a/source/_lovelace/picture-glance.markdown +++ b/source/_lovelace/picture-glance.markdown @@ -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 diff --git a/source/_lovelace/picture.markdown b/source/_lovelace/picture.markdown index 9fc235d5ab8..5b9b3a3fb81 100644 --- a/source/_lovelace/picture.markdown +++ b/source/_lovelace/picture.markdown @@ -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