Aohzan / hass-prixcarburant

Récupération des prix des stations en France
Apache License 2.0
30 stars 23 forks source link

Updated multi entity row template #39

Closed thomasboegl1 closed 7 months ago

thomasboegl1 commented 7 months ago

Hi,

Here is an updated version of the multi entity row template, maybe this can help someone :)

type: custom:auto-entities
card:
  type: entities
filter:
  template: |-
    {% for state in states.sensor -%}
      {%- if state.entity_id | regex_match("sensor.station\_.*\_e10", ignorecase=True) -%}
        {{
          {
          'entity': state.entity_id,
          'name': state.attributes.friendly_name.split()[1:-1] | join(" "),
          'type': "custom:multiple-entity-row",
          'entities': [
            {
              'entity': state.entity_id,
              'name': False
            },
          ],
          'attribute': 'days_since_last_update'
          }
        }},
      {%- endif -%}
    {%- endfor %}
Aohzan commented 7 months ago

Merci j'ai mis à jour le REAMDE : https://github.com/Aohzan/hass-prixcarburant/blob/master/README.fr.md#via-auto-entities-et-multiple-entity-row