Hey All, I am wondering if there’s a way to change the border of a custom button card. I’m using it to display the temperature and I have the color change on that depending on the numeric state and I tried to copy the code to change the border color but it didn’t work.
Here’s what I have:
type: custom:button-card
entity: sensor._gv_temperature
show_name: false
show_state: true
styles:
card:
- border-radius: 1
- color: |
[[[
if (entity.state <= 69.99) return 'khaki';
if (entity.state >= 70 && entity.state < 72) return 'yellowgreen';
if (entity.state >= 72 && entity.state < 77) return 'green';
if (entity.state >= 77 && entity.state < 79) return 'yellowgreen';
else return 'red';
]]]
# - border: |
# [[[
# if (entity.state <= 69.99) return 'khaki';
# if (entity.state >= 70 && entity.state < 72) return 'yellowgreen';
# if (entity.state >= 72 && entity.state < 77) return 'green';
# if (entity.state >= 77 && entity.state < 79) return 'yellowgreen';
# else return 'red';
# ]]]
icon:
- color: |
[[[
if (entity.state <= 69.99) return 'khaki';
if (entity.state >= 70 && entity.state < 72) return 'yellowgreen';
if (entity.state >= 72 && entity.state < 77) return 'green';
if (entity.state >= 77 && entity.state < 79) return 'yellowgreen';
else return 'red';
]]]