sorry for the direct tag @Ildar_Gabdullin, but latest card-mod gives me flickering badges which we discussed heavily before ;-=) …
what should I have changed according to the latests ideas of correct modding here:
style:
ha-state-label-badge:
$:
ha-label-badge:
$: |
.label-badge .label span{
color:
{% if is_state(config.entity,'home') %} gold;
{% else %} black;
{% endif %}
}
.: |
:host {
--label-badge-red:
{% set zones = states.zone|map(attribute='name')|list %}
{% if is_state(config.entity,'home') %} green;
{% elif 'bij' in states(config.entity) %} gold;
{% elif states(config.entity) in ['moving','driving'] or
states(config.entity) in zones %} mediumslateblue
{% else %} dimgrey;
{% endif %}
}
constant flickering of the state, and in a lesser way, the badge color…
I moved the :host section like:
style: |
:host {
--label-badge-red:
{% set zones = states.zone|map(attribute='name')|list %}
{% if is_state(config.entity,'home') %} green;
{% elif 'bij' in states(config.entity) %} gold;
{% elif states(config.entity) in ['moving','driving'] or
states(config.entity) in zones %} mediumslateblue
{% else %} dimgrey;
{% endif %}
}
ha-state-label-badge:
$:
ha-label-badge:
$: |
.label-badge .label span{
color:
{% if is_state(config.entity,'home') %} gold;
{% else %} black;
{% endif %}
}
which seems to stop flickering, but I am uncertain if this will even mod according to state when they change… also, I lost the coloring of the text in the label. So, cut it short:
how to combine the
style: |
:host
with the
style: |
ha-state-label-badge
rechecking: 🔹 Card-mod - Add css styles to any lovelace card which you adapted, makes me change to:
style:
ha-state-label-badge:
$:
ha-label-badge:
$:
.: |
.badge-container .label-badge .label span {
color:
{% if is_state(config.entity,'home') %} gold;
{% else %} black;
{% endif %}
}
.: |
ha-label-badge {
--label-badge-red:
{% set zones = states.zone|map(attribute='name')|list %}
{% if is_state(config.entity,'home') %} green;
{% elif 'bij' in states(config.entity) %} gold;
{% elif states(config.entity) in ['moving','driving'] or
states(config.entity) in zones %} mediumslateblue
{% else %} dimgrey;
{% endif %}
}
but then the flickering is back, and the page is almost unloadable, causing the fans overtime… must be me missing things
could you please have a check on this syntax? thanks!