thomasloven / lovelace-fold-entity-row

🔹 A foldable row for entities card, containing other rows
MIT License
561 stars 37 forks source link

Folded row entities not recognised as light entities / Friendly names cannot be overwritten in workaround #171

Closed gith-account closed 2 years ago

gith-account commented 2 years ago

My Home Assistant version: 2021.7.3

Fold-entity-row version (FROM BROWSER CONSOLE): 20.0.4

What I am doing:

I am using fold-entity-row on a lovelace card that shows lights in a room.

cards:
  - type: entities
    entities:
      - entity: light.sofa
      - type: custom:fold-entity-row
        head:
          entity: light.table_group
          name: table
      - type: custom:fold-entity-row
        head:
          entity: light.bookshelf_group
          name: bookshelf
    title: livingroom

What I expected to happen:

Usually, a header toggle appears on cards with multiple light entities to toggle all light entities on the card. I expected to see a header toggle next to the "livingroom" header that switches light.sofa, light.table_group, and light.bookshelf_group

What happened instead:

The custom fold-entity-row entities are not recognised as lights on the room level and the room is considered to only have one light (sofa). Accordingly, the expected header toggle next to “livingroom” is not shown and, if forced to show (“show_header_toggle: true”), only switches the sofa light.

Workaround / What I am doing:

cards:
  - type: entities
    entities:
      - entity: light.sofa
      - entity: light.table_group
        name: table
        type: custom:fold-entity-row
        head:
          entity: light.table_group
          name: table
      - entity: light.bookshelf_group
        name: bookshelf
        type: custom:fold-entity-row
        head:
          entity: light.bookshelf_group
          name: bookshelf
    title: livingroom

This fixes the above mentioned problem. However, with the following new problem:

What I expected to happen:

The friendly name of the light groups should be overwritten.

What happened instead:

Friendly names are not overwritten (tried in two locations in the above code, it fails in both).

Minimal steps to reproduce:

# The least ammount of code possible to reproduce my error

cards:
  - type: entities
    entities:
      - entity: light.sofa
      - entity: light.table_group
        name: table
        type: custom:fold-entity-row
        head:
          entity: light.table_group
          name: table
    title: livingroom

# End of code

Error messages from the browser console:

no relevant error messages found


By putting an X in the boxes ([X]) below, I indicate that I:

almighty059 commented 2 years ago

I was trying to accomplish the same thing and change the "friendly name" but nothing happens. I was also trying to hide the state. I wanted to do this without having to make it a "section". @gith-account did you have any luck in doing so?

thomasloven commented 2 years ago

See #144