thomasloven / lovelace-template-entity-row

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

Ability to use `template-entity-row` inside a "clickable" head of `fold-entity-row` #79

Closed ildar170975 closed 1 year ago

ildar170975 commented 2 years ago

Consider this example:

type: vertical-stack
cards:
  - type: entities
    entities:
      - type: custom:fold-entity-row
        head:
          type: custom:template-entity-row
          icon: mdi:car
          state: ''
          name: some label
        <<: &ref_settings
          open: true
          padding: 0
          #clickable: true
          entities:
            - entity: sun.sun
            - entity: sun.sun
            - entity: sun.sun
  - type: entities
    entities:
      - type: custom:fold-entity-row
        head:
          type: custom:template-entity-row
          icon: mdi:car
          state: ''
          name: ''
        <<: *ref_settings

image

Both cards are SAME, but the 1st card has a name specified.

Tapping on the head row on the 1st card - does NOT fold/unfold a list. Tapping on the head row on the 2nd card - DOES.

Specifying a clickable option does not help.

Is it a bug?

ildar170975 commented 1 year ago

Sorry, my mistake. Here is a working code - added "fire-dom-event":

  - type: entities
    entities:
      - type: custom:fold-entity-row
        head:
          type: custom:template-entity-row
          icon: mdi:car
          name: some name + fire-dom
          tap_action:
            action: fire-dom-event
            fold_row: true
        open: true
        padding: 0
        entities:
          - entity: sun.sun
          - entity: sun.sun
          - entity: sun.sun