Hey All,
I’m currently using the card-mod repo to change the color of the text in a card depending on the state. What I can’t figure out is how to get the icon to change colors as well. I see how to change it to one color that will always display but not how to make it change colors with the text. Here is the code I have to change the text:
- entity: sensor.allergy_index_today
card_mod:
style: |
:host {
color:
{% if states(config.entity) | int <= 2.4 %}
green
{% elif states(config.entity) | int <= 4.8 %}
greenyellow
{% elif states(config.entity) | int <= 7.2 %}
yellow
{% elif states(config.entity) | int <= 9.6 %}
orange
{% elif states(config.entity) | int <= 12 %}
red
{% endif %}
;
}
Thank you in advance for your time.