faire une compilation de Animation Badges - Home Assistant - Tutoriels & Partages / Interface / Lovelace / Thème / Custom Card - Home Assistant Communauté Francophone (hacf.fr) et d’une carte animée n’est pas si facile, (mode boulet ON)
voici ce que j’arrive à faire…pas du tout mon but LOL
voici le code :
color_type: icon
entity: binary_sensor.octoprint_connected
name: '[[[if (entity.state == "on") return "On"; else return "Off"]]]'
show_icon: true
show_last_changed: false
show_name: false
icon: 'mdi:printer-3d'
styles:
card:
- border-radius: 10px
label:
- font-size: 10px
name:
- font-variant: small-caps
- color: var(--primary-color)
icon:
- animation: |
[[[
if (entity.state == "on") return "printing 1s linear infinite alternate";
else if (entity.state == "off") return "printing 100s linear infinite alternate";
else return ;
]]]
- color: var(--primary-color)
tap_action:
action: null
type: 'custom:button-card'
style: |
@keyframes printing {
0% {
background-image: url("/local/img/ender/printer-3d-01.svg");
}
33% {
background-image: url("/local/img/ender/printer-3d-02.svg");
}
67% {
background-image: url("/local/img/ender/printer-3d-03.svg");
}
100% {
background-image: url("/local/img/ender/printer-3d-04.svg");
}
}
évidemment, le but serait de n’avoir que l’icone principale bouger … pas tout les mini icones en fond de cartes