thomasloven / lovelace-fold-entity-row

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

card_mod not applied if "open: false" #191

Closed ildar170975 closed 2 years ago

ildar170975 commented 2 years ago

My Home Assistant version: 2021.11.4

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

What I am doing: apply a card-mod style for folded items

What I expected to happen: the style is applied

What happened instead: the style is applied only if open: true

Minimal steps to reproduce:

type: entities
title: card_mod & open
card_mod:
  style:
    fold-entity-row:
      $:
        div#items hui-text-entity-row:
          $: |
            hui-generic-entity-row {
              color: red;
            }
entities:
  - type: custom:fold-entity-row
    open: true
    padding: 0
    head:
      entity: sun.sun
    entities:
      - entity: sun.sun
      - entity: sun.sun
      - entity: sun.sun
  - type: custom:fold-entity-row
    open: false
    padding: 0
    head:
      entity: sun.sun
    entities:
      - entity: sun.sun
      - entity: sun.sun
      - entity: sun.sun

image

Error messages from the browser console: no errors related to the card


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

thomasloven commented 2 years ago

This should be fixed in 2.0.12.

ildar170975 commented 2 years ago

Seems to be solved!

Mariusthvdb commented 2 years ago

perfect, thank you Thomas. Ildar and I spent the better part of the afternoon analyzing this, and I found an auto-entities group filter was the only way to solve it.

Can confirm we can now list the entities, and see proper spacing, direct, or as object with secondary_info. perfect!

Mariusthvdb commented 2 years ago

@thomasloven pardon the followup, but there's 1 thing happening now: on folds with the entities listed verbosely, the bottom entity is not getting all the vertical space it should and is clipped. With a simple icon/entity/state all on 1 line that is diffult to see (though noticeably less height is displayed below the entity and above the next fold):

Schermafbeelding 2021-11-20 om 13 21 43

but when using entity_picture,

Schermafbeelding 2021-11-20 om 13 20 00

or secondary_info

Schermafbeelding 2021-11-20 om 13 24 54

or double lined unit, it becomes clear immediately:

Schermafbeelding 2021-11-20 om 12 33 44

this doesnt happen when using auto-entities in the fold..

do you need a separate issue for this?

thomasloven commented 2 years ago

Yes please