thomasloven / lovelace-fold-entity-row

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

'unavailable' overflows card in fold #208

Closed Mariusthvdb closed 2 years ago

Mariusthvdb commented 2 years ago

My Home Assistant version: 2022.3.0.dev20220201

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

What I am doing:

showing several sensors off a sonoff switch

What I expected to happen:

have the 'unavailable' of the sensors in the fold remain within the card What happened instead:

Schermafbeelding 2022-02-01 om 12 02 28

this is a switch, which only populates these sensors in 'on' state:

Schermafbeelding 2022-02-01 om 11 52 22

which makes another fine example for the FR https://github.com/thomasloven/lovelace-fold-entity-row/issues/193 , if none of these are available, dont show the fold.

Minimal steps to reproduce:

# The least amount of code possible to reproduce my error
  - type: entities
    title: Symfonisk dining
    card_mod: *header
    show_header_toggle: false
    entities:
      - switch.symfonisk_dining
      - media_player.symfonisk

      - type: custom:fold-entity-row
        head:
          type: section
          label: Settings
          card_mod:
            style: |
              .label {
                margin-left: 0px;
              }
        padding: 0
        no_animation: true
        entities:
          - switch.sonos_symfonisk_crossfade
          - switch.sonos_symfonisk_status_light
          - switch.sonos_symfonisk_touch_controls
          - number.symfonisk_bass
          - number.symfonisk_treble
# End of code

Error messages from the browser console: nothing relevant

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

thomasloven commented 2 years ago

Things that happen in fold-entity-row and also without fold-entity-row are not caused by fold-entity-row.

image

thomasloven commented 2 years ago

Also, this is rather an excellent counterexample.

- type: conditional
  conditions:
    - entity: switch.symfonisk_dining
      state: "on"
  row:
    type: custom:fold-entity-row
        ...
Mariusthvdb commented 2 years ago

thanks Thomas, I've grown accustomed to prevent the conditional as much as possible, because it always leaves a small gap. In this case that isnt really harming the card, so yes, a great solution

as for the overflow: I hadn't noticed it in any other card yet. and have comparable card showing correctly:

Schermafbeelding 2022-02-01 om 13 17 13

this being a number issue then? in which case I ll drop a line in the frontend repo.

please close? I can't seem to find the button for that below

Mariusthvdb commented 2 years ago

one more thing...

I made a mistake and did:

    entities:
      - switch.symfonisk_dining
      - media_player.symfonisk

      - type: conditional
        conditions:
          - entity: switch.symfonisk_dining
            state: 'on'
        row:
          - type: custom:fold-entity-row
            head:
              type: section
              label: Settings

instead of leaving the - out in front of type_custom:fold-entity-row , as you showed in your suggestion above.

this lead to an error which source I cant understand:

Schermafbeelding 2022-02-01 om 13 33 03

mentioning ha-logbook and auto-entities.

At first I thought it might have to do with several anchors (which could be declared above in an auto-entities ,) so I created a standalone card config. Still that error remains.

Ive fixed the card, working beautifully, but the error is mesmerizing....