Hi everybody,
in a picture elements card, the purpose is to place a state-icon that should rotate and spin to show that a fan is turned on.
I have card_mod installed.
I made the icon spin, but it doesnt spin on its axis and transform-origin seems to be useless.
after days I must surrender and ask help:
here s the code:
- type: picture-elements
image: local/y-07-bagnobianco.png
title: null
card_mod:
style: >
ha-card {
color: black; background: white; box-shadow: none;
}
@keyframes my-blink {
from {opacity: 0;} to {opacity: 100;}
from {opacity: 100;} to {opacity: 0;}
}
@keyframes rotation{
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
:host {
--animation-07-02: {% if
is_state('input_select.icona_smart_plug_bagno_bianco', '0') and
is_state('switch.bagno_bianco_stufetta_o_ventilatore_locale_outlet','on')%}
rotation 1s linear infinite {% else %} none {%endif%}
}
elements:
- type: state-icon
entity: switch.bagno_bianco_stufetta_o_ventilatore_template
style:
top: 1%
left: 90%
'--mdc-icon-size': 42px
animation: var(--animation-07-02)
tap_action:
action: toggle