Is it possible to turn stop displaying buttons entirely based on state? #65
-
I recently discovered this card and I must say it is fantastic! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Yep, should be pretty easy with - type: custom:paper-buttons-row
buttons:
- entity: light.bedroom_light
state_styles:
'off':
button:
display: none or with Jinja templates - type: custom:paper-buttons-row
buttons:
- entity: light.bedroom_light
style:
button:
background: black
display: "{{ is_state(config.entity, 'off') and 'none' }}"
# display: "{{ is_state('light.bedroom_light', 'off') and 'none' }}" |
Beta Was this translation helpful? Give feedback.
-
Wow Thanks - that is perfect & pretty easy! This is a fantastic piece of work. I was also wondering if you could recommend a method to make these buttons further dynamic:
state_styles:
disarmed:
state:
display: none Or even use a jinja template to display the state if certain conditions are met, (as you've shown above) but it would be great if I could add +1 to a variable each time a button is displayed - and when that number reaches 4 for instance, the state text disappears and youre left with just the icon. Thanks for your help though, this is already quite an awesome addition to my dashboard! |
Beta Was this translation helpful? Give feedback.
Yep, should be pretty easy with
state_styles
or by templating thedisplay
css property.or with Jinja templates