From 7eea0a9a4db450ea81731fb64581c206bd877df5 Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Wed, 18 Sep 2019 06:16:45 -0500 Subject: [PATCH] Add options to badges (#10286) * Update views.markdown https://github.com/home-assistant/home-assistant-polymer/pull/3552 * :ambulance: Fixed build --- source/lovelace/views.markdown | 40 +++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/source/lovelace/views.markdown b/source/lovelace/views.markdown index 90521bd346b..0e16aff7c1a 100644 --- a/source/lovelace/views.markdown +++ b/source/lovelace/views.markdown @@ -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.