thomasloven/lovelace-fold-entity-row

'unavailable' overflows card in fold

Mariusthvdb opened this issue · 4 comments

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 #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:

  • Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).
  • Have made sure I am using the latest version of the plugin.
  • Have followed the troubleshooting steps of the "Common Problems" section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.
  • Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.

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

image

Also, this is rather an excellent counterexample.

- type: conditional
  conditions:
    - entity: switch.symfonisk_dining
      state: "on"
  row:
    type: custom:fold-entity-row
        ...

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

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....