Labels and template love
New features
-
New option
label
: can be used for anything, if template is needed, uselabel_template
. Both are also available perstate
. Fixes #112, Fixes #120 -
New option
show_label
: default isfalse
. To display thelabel
orlabel_template
field -
New
layout
:icon_label
to display the label on the right side of the icon -
templating support 🎉 in
label_template
andstate
with thetemplate
operator. For more advanced templates, please use the config-template-card. The next version ofconfig-template-card
(available soon) will fix the issue you all had in the past.- In
label_template
:
- type: "custom:button-card" color_type: icon entity: light.test_light label_template: > var bri = states['light.test_light'].attributes.brightness; return 'Brightness: ' + (bri ? bri : '0') + '%'; show_label: true size: 15% style: - height: 100px - type: "custom:button-card" color_type: icon entity: light.test_light layout: icon_label label_template: > return 'Other State: ' + states['switch.skylight'].state; show_label: true show_name: false style: - height: 100px
value
withtemplate
operator- type: "custom:button-card" color_type: icon entity: switch.skylight show_state: true show_label: true state: - operator: template value: > return states['light.test_light'].attributes && (states['light.test_light'].attributes.brightness <= 100) icon: mdi:alert - operator: default icon: mdi:lightbulb - type: "custom:button-card" color_type: icon entity: light.test_light show_label: true state: - operator: template value: > return states['input_select.light_mode'].state === 'night_mode' icon: mdi:weather-night label: Night Mode - operator: default icon: mdi:white-balance-sunny label: Day Mode
- In
Fixes
- Blank card was not following the specified width