Hey folks, happy holidays!
Making some good progress on cleaning up my very lazy old way of making cards flash under certain conditions. I’m getting close with this one. The last bit is that when the card-mod is not activated, the background is this dark-grey, which I want. But then when the condition is met and card-mod is applied, it flashes orange (which I want), but alternates to a transparent background. What I’d like is for it to flash the dark grey to orange, which is why I thought “inherit” is appropriate… Any advice?
UPDATE: I’ve fixed it, but only by hard-coding the colour to #1c1c1c. I’d still like it to just inherit the colour from the base card, if possible.
Also, if there’s a way to further simplify this code and achieve the same result, please let me know! I want to perfect it on one before I go do the rest
type: custom:mushroom-entity-card
entity: sensor.litter_robot_4_litter_level
name: Litter Level
icon: mdi:cat
layout_options:
grid_columns: 2
grid_rows: 1
card_mod:
style: |
ha-card {
{% if states('sensor.litter_robot_4_litter_level') | float < 50 %}
animation: flashAnimation 3s infinite;
{% endif %} }
@keyframes flashAnimation {
0%, 49% { background-color: inherit; }
50%, 100% { background-color: orange; }
}