Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add entity badge #33866

Merged
merged 3 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/_dashboards/tile.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ hide_state:
state_content:
required: false
description: >
Content to display for the state. Can be `state`, `last-changed`, or any attribute of the entity. Can be either a string with a single item, or a list of string items. Default depends on the entity domain.
Content to display for the state. Can be `state`, `last_changed`, `last_updated`, or any attribute of the entity. Can be either a string with a single item, or a list of string items. Default depends on the entity domain.
type: [string, list]
tap_action:
required: false
Expand Down
60 changes: 60 additions & 0 deletions source/dashboards/badges.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,66 @@ Badges are widgets that sit at the top of a panel, above all the cards.
Badges at the top of a panel.
</p>

## Entity Badge
c0ffeeca7 marked this conversation as resolved.
Show resolved Hide resolved

The Entity badge allows you to display the state of an entity on a badge. This badge supports [actions](/dashboards/actions/).

```yaml
type: entity
entity: light.living_room
```

{% configuration entity %}
type:
required: true
description: "`entity`"
type: string
entity:
required: true
description: Entity ID.
type: string
name:
required: false
description: Overwrites the entity name.
type: string
icon:
required: false
description: Overwrites the entity icon.
type: string
color:
required: false
description: Set the color when the entity is active. By default, the color is based on `state`, `domain`, and `device_class` of your entity. It accepts [color token](/dashboards/tile/#available-colors) or hex color code.
type: string
default: state
show_entity_picture:
required: false
description: If your entity has a picture, it will replace the icon.
type: boolean
default: false
display_type:
required: false
description: Type of display for the badge. It can be either `minimal` (icon only), `standard` (icon and state) or `complete` (icon, state and name).
c0ffeeca7 marked this conversation as resolved.
Show resolved Hide resolved
type: string
default: standard
state_content:
required: false
description: >
Content to display for the state. Can be `state`, `last_changed`, `last_updated`, or any attribute of the entity. Can be either a string with a single item, or a list of string items. Default depends on the entity domain.
type: [string, list]
frenck marked this conversation as resolved.
Show resolved Hide resolved
tap_action:
required: false
description: Action taken on card tap. See [action documentation](/dashboards/actions/#tap-action). By default, it will show the "more-info" dialog.
type: map
hold_action:
required: false
description: Action taken on tap-and-hold. See [action documentation](/dashboards/actions/#hold-action).
type: map
double_tap_action:
required: false
description: Action taken on double tap. See [action documentation](/dashboards/actions/#double-tap-action).
type: map
{% endconfiguration %}

## State Label Badge
c0ffeeca7 marked this conversation as resolved.
Show resolved Hide resolved

The State Label badge allows you to display a state badge. This badge supports [actions](/dashboards/actions/).
c0ffeeca7 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Binary file modified source/images/dashboards/badges.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.