thomasloven / lovelace-template-entity-row

🔹 Display whatever you want in an entities card row.
MIT License
210 stars 16 forks source link

config.entity not supported in card-mod [WRONG ISSUE] #92

Closed ildar170975 closed 1 year ago

ildar170975 commented 1 year ago

The config.entity variable is supported for defining values for name, icon etc:

  - type: custom:template-entity-row
    entity: input_boolean.test_boolean
    state: >-
      {{states(config.entity)}}

изображение

but does not work inside card-mod - we have to use an entity_id explicitly:

type: entities
entities:
  - entity: input_boolean.test_boolean
  - type: custom:template-entity-row
    entity: input_boolean.test_boolean
    state: state
    card_mod:
      style:
        div#wrapper: |
          .state {
            color: magenta;
          }
  - type: custom:template-entity-row
    entity: input_boolean.test_boolean
    state: state
    card_mod:
      style:
        div#wrapper: |
          .state {
            {% if is_state('input_boolean.test_boolean','on') %}
            color: magenta;
            {% else %}
            color: cyan;
            {% endif %}
          }
  - type: custom:template-entity-row
    entity: input_boolean.test_boolean
    state: state
    card_mod:
      style:
        div#wrapper: |
          .state {
            {% if is_state('config.entity','on') %}
            color: magenta;
            {% else %}
            color: cyan;
            {% endif %}
          }

изображение

ildar170975 commented 1 year ago

My bad. config.entity must be used w/o '. Sorry!