Can someone help me with this? After the 3.0x update, I don’t get my animation running again. I tried to change ha-icon by ha-state-icon and mushroom-state-icon. Even tried to change the code like @LeiChat wrote in his post, but unfortunately no animation.
Original code which was working before update:
type: custom:mushroom-template-card
icon: mdi:fan
entity: switch.ventilator
tap_action:
action: toggle
icon_color: '{{ ''green'' if is_state(''switch.ventilator'', ''on'') else ''grey'' }}'
primary: Ventilator
secondary: '{{ states(entity) | title }}'
hold_action:
action: none
double_tap_action:
action: none
card_mod:
style:
mushroom-shape-icon$: |
{% if is_state('switch.ventilator','on') %}
ha-icon {
--icon-animation: spin 1s linear infinite;
}
@keyframes shake {
0%, 100% { transform: translate(0, 0) rotate(0); }
20% { transform: translate(0.4px, -0.4px) rotate(-4deg); }
40% { transform: translate(-0.4px, 0.4px) rotate(4deg); }
60% { transform: translate(0.4px, 0.4px) rotate(-4deg); }
80% { transform: translate(-0.4px, -0.4px) rotate(4deg); }
}
@keyframes drum {
50% { clip-path: polygon(0 0, 0 100%, 35% 100%, 34% 68%, 60% 41%, 71% 56%, 65% 74%, 47% 79%, 32% 69%, 35% 100%, 100% 100%, 100% 0); }
}
{% else %}
{% endif %}
}
After trying changing ha-icon to ha-state-icon or mushroom-state-icon, I tried this too, but no animation.
type: custom:mushroom-template-card
icon: mdi:fan
entity: switch.ventilator
tap_action:
action: toggle
icon_color: '{{ ''green'' if is_state(''switch.ventilator'', ''on'') else ''grey'' }}'
primary: Ventilator
secondary: '{{ states(entity) | title }}'
hold_action:
action: none
double_tap_action:
action: none
card_mod:
style: |
ha-state-icon {
{{ '--icon-animation: spin 1s linear infinite;' if is_state('switch.ventilator','on') }}
}
@keyframes shake {
0%, 100% { transform: translate(0, 0) rotate(0); }
20% { transform: translate(0.4px, -0.4px) rotate(-4deg); }
40% { transform: translate(-0.4px, 0.4px) rotate(4deg); }
60% { transform: translate(0.4px, 0.4px) rotate(-4deg); }
80% { transform: translate(-0.4px, -0.4px) rotate(4deg); }
}
@keyframes drum {
50% { clip-path: polygon(0 0, 0 100%, 35% 100%, 34% 68%, 60% 41%, 71% 56%, 65% 74%, 47% 79%, 32% 69%, 35% 100%, 100% 100%, 100% 0); }
}
{% else %}
{% endif %}
}
Please assist.