Bonjour
Petit soucis du à ma non expérience du code dsl.
J’essaie de mettre une icône clignotante quand la lumière est allumée et non clignotante quand éteinte.
Je vous joint le code que j’ai mis mais je doit merder dans le code, si un expert pouvait m’aider avec ce code ?
Merci à vous
type: custom:mushroom-template-card
icon: mdi:ceiling-light-multiple-outline
tap_action:
action: more-info
primary: |-
{% if states('light.lumi_lumi_switch_b1lc04_light') == 'on'%}
Allumé
{% elif states('light.lumi_lumi_switch_b1lc04_light') > 'off' %}
Eteint
{%endif%}
secondary: |-
{{ states('light.lumi_lumi_switch_b1lc04_light', 'current_consumption') }}
Salle
multiline_secondary: true
fill_container: true
icon_color: orange
layout: vertical
entity: light.lumi_lumi_switch_b1lc04_light
card_mod:
style:
mushroom-state-info$: |
.container {
--primary-text-color: coral;
--secondary-text-color: purple;
--card-secondary-font-size:15px;
--card-primary-font-size: 14px;
}
mushroom-shape-icon$: |
.shape {
--icon-symbol-size: 30px;
--icon-size: 40px;
--shape-animation: ping 2s infinite;
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
80% {box-shadow: 0 0 0 10px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
}
.: |
ha-card {
padding: 10px !important;
}
Là, ton animation agit sur l’ombrage de l’icône et pas la couleur de l’icône (box-shadow).
Merci
Mais en faite je voudrais faire simple quand la lumière est allumée que l’icône clignote et quand éteindre quel clignote pas
Merci
Herbs
Février 4, 2024, 4:03
4
Salut @Qualif22
Tu peux tester ça :
type: custom:mushroom-template-card
icon: mdi:ceiling-light-multiple-outline
tap_action:
action: more-info
primary: |-
{% if states('light.lumi_lumi_switch_b1lc04_light') == 'on'%}
Allumé
{% elif states('light.lumi_lumi_switch_b1lc04_light') > 'off' %}
Eteint
{%endif%}
secondary: |-
{{ states('light.lumi_lumi_switch_b1lc04_light', 'current_consumption') }}
Salle
multiline_secondary: true
fill_container: true
icon_color: orange
layout: vertical
entity: light.lumi_lumi_switch_b1lc04_light
card_mod:
style: |
mushroom-state-info$: |
.container {
--primary-text-color: coral;
--secondary-text-color: purple;
--card-secondary-font-size:15px;
--card-primary-font-size: 14px;
}
.: |
ha-card {
padding: 10px !important;
}
ha-state-icon {
{% if states('light.lumi_lumi_switch_b1lc04_light') == 'on' %}
animation: blink 2s linear infinite;
{% endif %}
}
@keyframes blink {
0% { opacity: 1; }
50% { opacity: 0; }
100% { opacity: 1; }
}
1 « J'aime »
Lol @Herbs , encore en train de donner la solution clé en main
Je lui avais mis le doigt sur ce qui n’allait pas pourtant
Herbs
Février 4, 2024, 4:13
6
Ouais l’animation n’était pas la bonne et en plus ça « tapait » pas au bon endroit
Merci pour l’aide
J’avais réussi et je testait justement et j’ai pas eu le temps de remercier ceux qui on aidé.
Merci à vous
Super, passe ton sujet en résolu alors
Tu va rire comment on passe resolu sur ce site ?
Il doit y avoir une case à cocher à gauche de Répondre sur chacun des messages. Tu la coche sur celui qui t’a permis de résoudre ton problème.
Remets la solution sur le message d’ @Herbs
1 « J'aime »