Hello
I have a problem with a button icon color
No mater what the state is it’s always return false
- type: custom:button-card
template: header
entity: binary_sensor.1bgt360_park_brake_status
show_state: true
show_name: false
styles:
state:
- color: white
- font-size: 12px
icon:
- color: |
[[[ if (entity.state == 'Aan') return "Green" ;
else return "blue"; ]]]
The state show me Aan or Off but even if i set it to true or Aan of On it’s always return blue
Second question i try to play with templates
button_card_templates:
header:
styles:
card:
- background-color: var(--paper-item-icon-active-color)
name:
- text-transform: uppercase
- color: var(--primary-background-color)
- justify-self: start
- font-weight: bold
label:
- text-transform: uppercase
- color: var(--primary-background-color)
- justify-self: start
- font-weight: bold
header_red:
template: header
styles:
card:
- background-color: '#FF0000'
but if i add these parameters to the template it wont work
styles:
state:
- color: white
- font-size: 12px
button_card_templates:
header:
show_state: true
show_name: false
styles:
card:
- background-color: var(--paper-item-icon-active-color)
name:
- text-transform: uppercase
- color: var(--primary-background-color)
- justify-self: start
- font-weight: bold
label:
- text-transform: uppercase
- color: var(--primary-background-color)
- justify-self: start
- font-weight: bold
header_red:
template: header
styles:
state:
- color: white
- font-size: 12px
card:
- background-color: '#FF0000'
And can i add a separate yaml file to use with my template’s and use include or do i need to add them to te lovelace file,because if you have x different templat’s it will become messy i think
Thx