Skip to content

Commit

Permalink
Tap action page (home-assistant#12229)
Browse files Browse the repository at this point in the history
* Add tap-action document

* Add commas

* Apply suggestions from code review

Co-Authored-By: Franck Nijhof <[email protected]>

Co-authored-by: Franck Nijhof <[email protected]>
  • Loading branch information
PurelyNicole and frenck authored Mar 2, 2020
1 parent 025f5e6 commit 361cec2
Show file tree
Hide file tree
Showing 10 changed files with 243 additions and 1,182 deletions.
1 change: 1 addition & 0 deletions source/_includes/asides/lovelace_navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ <h1 class="title delta">Advanced</h1>
<li>{% active_link /lovelace/header-footer/ Headers & Footers %}</li>
<li>{% active_link /lovelace/yaml-mode/ YAML mode %}</li>
<li>{% active_link /lovelace/views/ Views %}</li>
<li>{% active_link /lovelace/actions/ Actions %}</li>
<li><a href='https://developers.home-assistant.io/docs/en/lovelace_custom_card.html'>Developing Custom Cards <i icon='icon-external-link'></i></a></li>
</ul>
</div>
Expand Down
113 changes: 3 additions & 110 deletions source/_lovelace/button.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -57,129 +57,22 @@ state_color:
default: true
tap_action:
required: false
description: Action to take on tap
description: Action taken on card tap. See [action documentation](/lovelace/actions/#tap-action).
type: map
keys:
action:
required: true
description: "Action to perform (`more-info`, `toggle`, `call-service`, `navigate`, `url`, `none`)"
type: string
default: "`toggle`"
navigation_path:
required: false
description: "Path to navigate to (e.g., `/lovelace/0/`) when `action` defined as `navigate`"
type: string
default: none
url_path:
required: false
description: "Path to navigate to (e.g., `https://www.home-assistant.io`) when `action` defined as `url`"
type: string
default: none
service:
required: false
description: "Service to call (e.g., `media_player.media_play_pause`) when `action` defined as `call-service`"
type: string
default: none
service_data:
required: false
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
description: Action taken on card tap and hold. See [action documentation](/lovelace/actions/#hold-action).
type: map
keys:
action:
required: true
description: "Action to perform (`more-info`, `toggle`, `call-service`, `navigate`, `url`, `none`)"
type: string
default: "`more-info`"
navigation_path:
required: false
description: "Path to navigate to (e.g., `/lovelace/0/`) when `action` defined as `navigate`"
type: string
default: none
url_path:
required: false
description: "Path to navigate to (e.g., `https://www.home-assistant.io`) when `action` defined as `url`"
type: string
default: none
service:
required: false
description: "Service to call (e.g., `media_player.media_play_pause`) when `action` defined as `call-service`"
type: string
default: none
service_data:
required: false
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
description: Action taken on card double tap. See [action documentation](/lovelace/actions/#double-tap-action).
type: map
keys:
action:
required: true
description: "Action to perform (`more-info`, `toggle`, `call-service`, `navigate`, `url`, `none`)"
type: string
default: "`more-info`"
navigation_path:
required: false
description: "Path to navigate to (e.g., `/lovelace/0/`) when `action` defined as `navigate`"
type: string
default: none
url_path:
required: false
description: "Path to navigate to (e.g., `https://www.home-assistant.io`) when `action` defined as `url`"
type: string
default: none
service:
required: false
description: "Service to call (e.g., `media_player.media_play_pause`) when `action` defined as `call-service`"
type: string
default: none
service_data:
required: false
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 %}
Expand Down
84 changes: 3 additions & 81 deletions source/_lovelace/entities.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -99,94 +99,16 @@ state_color:
default: false
tap_action:
required: false
description: Action to take on tap
description: Action taken on card tap. See [action documentation](/lovelace/actions/#tap-action).
type: map
keys:
action:
required: true
description: "Action to perform (`more-info`, `toggle`, `call-service`, `navigate`, `url`, `none`)"
type: string
default: "`toggle`"
navigation_path:
required: false
description: "Path to navigate to (e.g., `/lovelace/0/`) when `action` defined as `navigate`"
type: string
default: none
url_path:
required: false
description: "Path to navigate to (e.g., `https://www.home-assistant.io`) when `action` defined as `url`"
type: string
default: none
service:
required: false
description: "Service to call (e.g., `media_player.media_play_pause`) when `action` defined as `call-service`"
type: string
default: none
service_data:
required: false
description: "Service data to include (e.g., `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
hold_action:
required: false
description: Action to take on tap-and-hold
description: Action taken on card tap and hold. See [action documentation](/lovelace/actions/#hold-action).
type: map
keys:
action:
required: true
description: "Action to perform (`more-info`, `toggle`, `call-service`, `navigate`, `url`, `none`)"
type: string
default: "`more-info`"
navigation_path:
required: false
description: "Path to navigate to (e.g., `/lovelace/0/`) when `action` defined as `navigate`"
type: string
default: none
url_path:
required: false
description: "Path to navigate to (e.g., `https://www.home-assistant.io`) when `action` defined as `url`"
type: string
default: none
service:
required: false
description: "Service to call (e.g., `media_player.media_play_pause`) when `action` defined as `call-service`"
type: string
default: none
service_data:
required: false
description: "Service data to include (e.g., `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
double_tap_action:
required: false
description: Action to take on double tap
description: Action taken on card double tap. See [action documentation](/lovelace/actions/#double-tap-action).
type: map
keys:
action:
required: true
description: "Action to perform (`more-info`, `toggle`, `call-service`, `navigate`, `url`, `none`)"
type: string
default: "`more-info`"
navigation_path:
required: false
description: "Path to navigate to (e.g., `/lovelace/0/`) when `action` defined as `navigate`"
type: string
default: none
url_path:
required: false
description: "Path to navigate to (e.g., `https://www.home-assistant.io`) when `action` defined as `url`"
type: string
default: none
service:
required: false
description: "Service to call (e.g., `media_player.media_play_pause`) when `action` defined as `call-service`"
type: string
default: none
service_data:
required: false
description: "Service data to include (e.g., `entity_id: media_player.bedroom`) when `action` defined as `call-service`"
type: string
default: none
{% endconfiguration %}

## Special Row Elements
Expand Down
113 changes: 3 additions & 110 deletions source/_lovelace/glance.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -87,123 +87,16 @@ show_state:
default: true
tap_action:
required: false
description: Action to take on tap
description: Action taken on card tap. See [action documentation](/lovelace/actions/#tap-action).
type: map
keys:
action:
required: true
description: "Action to perform (`more-info`, `toggle`, `call-service`, `navigate`, `url`, `none`)"
type: string
default: "`more-info`"
navigation_path:
required: false
description: "Path to navigate to (e.g., `/lovelace/0/`) when `action` defined as `navigate`"
type: string
default: none
url_path:
required: false
description: "Path to navigate to (e.g., `https://www.home-assistant.io`) when `action` defined as `url`"
type: string
default: none
service:
required: false
description: "Service to call (e.g., `media_player.media_play_pause`) when `action` defined as `call-service`"
type: string
default: none
service_data:
required: false
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
description: Action taken on card tap and hold. See [action documentation](/lovelace/actions/).
type: map
keys:
action:
required: true
description: "Action to perform (`more-info`, `toggle`, `call-service`, `navigate`, `url`, `none`)"
type: string
default: "`more-info`"
navigation_path:
required: false
description: "Path to navigate to (e.g., `/lovelace/0/`) when `action` defined as `navigate`"
type: string
default: none
url_path:
required: false
description: "Path to navigate to (e.g., `https://www.home-assistant.io`) when `action` defined as `url`"
type: string
default: none
service:
required: false
description: "Service to call (e.g., `media_player.media_play_pause`) when `action` defined as `call-service`"
type: string
default: none
service_data:
required: false
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
description: Action taken on card double tap. See [action documentation](/lovelace/actions/#double-tap-action).
type: map
keys:
action:
required: true
description: "Action to perform (`more-info`, `toggle`, `call-service`, `navigate`, `url`, `none`)"
type: string
default: "`more-info`"
navigation_path:
required: false
description: "Path to navigate to (e.g., `/lovelace/0/`) when `action` defined as `navigate`"
type: string
default: none
url_path:
required: false
description: "Path to navigate to (e.g., `https://www.home-assistant.io`) when `action` defined as `url`"
type: string
default: none
service:
required: false
description: "Service to call (e.g., `media_player.media_play_pause`) when `action` defined as `call-service`"
type: string
default: none
service_data:
required: false
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
Expand Down
Loading

0 comments on commit 361cec2

Please sign in to comment.