The code I posted was from March and was for that specific scenario. To ensure the provided resolution is clear, there have been Breaking Changes with the latest updates to the Mushroom code. Those changes are discussed in the main Mushroom threads here and here
Legacy Template Card
type: custom:mushroom-legacy-template-card
layout: vertical
tap_action:
action: toggle
icon: mdi:tablet-dashboard
icon_color: red
badge_icon: mdi:battery-high
badge_color: red
card_mod:
style:
mushroom-badge-icon$: |
ha-icon {
animation: charge 3s steps(1) infinite;
}
@keyframes charge {
0% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 24%,67% 24%, 67% 84%, 34% 84%, 34% 100%, 100% 100%, 100% 0%);}
20% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 24%, 67% 24%, 67% 64%, 34% 64%, 34% 100%, 100% 100%, 100% 0%); }
40% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 24%, 67% 24%, 67% 44%, 34% 44%, 34% 100%, 100% 100%, 100% 0%); }
60% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 24%, 67% 24%, 67% 24%, 34% 24%, 34% 100%, 100% 100%, 100% 0%); }
}
New Mushroom Template Card
type: custom:mushroom-template-card
layout: vertical
tap_action:
action: toggle
icon: mdi:tablet-dashboard
icon_color: red
badge_icon: mdi:battery-high
badge_color: red
card_mod:
style:
ha-icon$: |
ha-svg-icon {
animation: charge 3s steps(1) infinite;
}
@keyframes charge {
0% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 24%,67% 24%, 67% 84%, 34% 84%, 34% 100%, 100% 100%, 100% 0%);}
20% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 24%, 67% 24%, 67% 64%, 34% 64%, 34% 100%, 100% 100%, 100% 0%); }
40% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 24%, 67% 24%, 67% 44%, 34% 44%, 34% 100%, 100% 100%, 100% 0%); }
60% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 24%, 67% 24%, 67% 24%, 34% 24%, 34% 100%, 100% 100%, 100% 0%); }
}