Add options to badges (#10286)

* Update views.markdown

https://github.com/home-assistant/home-assistant-polymer/pull/3552

* 🚑 Fixed build
This commit is contained in:
Ian Richardson 2019-09-18 06:16:45 -05:00 committed by Franck Nijhof
parent 729ba9f081
commit 7eea0a9a4d

View File

@ -22,7 +22,7 @@ views:
type: string
badges:
required: false
description: List of entities IDs to display as badge.
description: List of entities IDs or `badge` objects to display as badges.
type: list
cards:
required: false
@ -52,6 +52,44 @@ views:
type: string
{% endconfiguration %}
## Options For Badges
If you define badges as objects instead of strings (by adding `entity:` before entity ID), allowing you to add more customizations:
{% configuration badges %}
entity:
required: true
description: Home Assistant entity ID.
type: string
name:
required: false
description: Overwrites friendly name.
type: string
icon:
required: false
description: Overwrites icon or entity picture.
type: string
image:
required: false
description: The URL of an image.
type: string
{% endconfiguration %}
### Example
View config:
```yaml
- title: Living room
badges:
- device_tracker.demo_paulus
- entity: light.ceiling_lights
name: Ceiling Lights
icon: mdi:bulb
- entity: switch.decorative_lights
image: /local/lights.png
```
## Paths
You can link to one view from another view by its path. For this use cards that support navigation (`navigation_path`). Do not use special characters in paths.