thomasloven/lovelace-fold-entity-row

using fold inside entities of an auto-entities throws: Doing it wrong

Mariusthvdb opened this issue · 5 comments

My Home Assistant version: 2022.2.0.dev20220119
Fold-entity-row version (FROM BROWSER CONSOLE):
20.0.11 (same on latest, but I need this version because of clipping of last child in latest f-e-r)

What I am doing:
adding a fold in the entities section of an auto-entities

What I expected to happen:
no error (the card displays just fine)

What happened instead:
see error in console

aware this is not a 'true' entities card, still was surprising to see the error, though of no consequence. Just letting you know this might be the exception to the rule, and maybe an error could be suppressed.

Minimal steps to reproduce:

# The least ammount of code possible to reproduce my error
type: custom:auto-entities
card:
  type: entities # <-- 
  title: Netwerk
show_empty: false
entities:
  - device_tracker.unifi_udmpro
  - etc etc

  - type: custom:fold-entity-row
    head:
      type: section
      label: Unifi protect
    padding: 0
    entities:
# End of code

Error messages from the browser console:
Schermafbeelding 2022-01-19 om 12 59 38

full card config:

type: custom:auto-entities
card:
  type: entities
  title: Netwerk
  card_mod:
    style: |
      .card-header {
        background-color: var(--background-color-off);
        color: var(--text-color-off);
        padding-top: 0px;
        padding-bottom: 0px;
        margin: 0px 0px 16px 0px;
      }
show_empty: false
entities:
  - device_tracker.unifi_udmpro
  - device_tracker.unifi_uap_ac_pro_hall
  - device_tracker.unifi_uap_ac_pro_gym

  - type: custom:fold-entity-row
    head:
      type: section
      label: Unifi protect
    padding: 0
    entities:
      - type: custom:auto-entities
        card:
          type: entities
          card_mod:
            style: |
              ha-card {
                margin: 0px -16px;
              }
        filter:
          include:
            - entity_id: sensor.udm_pro_*
filter:
  include:
    - entity_id: device_tracker.unifi_ae_*
      options:
        secondary_info: last-changed
sort:
  method: state

Schermafbeelding 2022-01-19 om 13 07 06


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. *but now use a version below
  • 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.

I confirm the error message (Win10x64, Chrome, HA 2021.12.10) with a bit simpler code:
изображение

type: custom:auto-entities
card:
  type: entities
  title: Netwerk
show_empty: false
entities:
  - sun.sun
  - type: section
  - type: custom:fold-entity-row
    head:
      type: section
      label: Unifi protect
    padding: 0
    entities:
      - binary_sensor.updater
      - binary_sensor.updater
      - type: section
filter:
  include:
    - entity_id: input_number.test_*
sort:
  count: 5

изображение
Another thing is that using count: 5 causes showing 5 lines including the "static lines" but this is another issue.

hmm, how odd. definitely keep seeing it, even tested it with your:

  - type: custom:fold-entity-row
    head:
      type: section
      label: Unifi protect
    padding: 0
    entities:
      - sun.sun
      - entity: sun.sun

and nothing else in that fold. Red message remains.

I made a mistake and then updated my post

Currently you may split your card into separate cards in stack, then there is no errors:

type: custom:stack-in-card
cards:
  - type: entities
    title: Netwerk
    entities:
      - sun.sun
      - type: section
      - type: custom:fold-entity-row
        head:
          type: section
          label: Unifi protect
        padding: 0
        entities:
          - binary_sensor.updater
          - binary_sensor.updater
  - type: custom:auto-entities
    card:
      type: entities
    entities:
      - type: section
    show_empty: false
    filter:
      include:
        - entity_id: input_number.test_*
    sort:
      count: 5

изображение

yeah. Being a sucker for core entities: I can use:

type: entities
title: Netwerk
card_mod:
  style: |
    .card-header {
      background-color: var(--background-color-off);
      color: var(--text-color-off);
      padding-top: 0px;
      padding-bottom: 0px;
      margin: 0px 0px 16px 0px;
    }
entities:
  - device_tracker.unifi_udmpro
  - device_tracker.unifi_uap_ac_pro_hall
  - device_tracker.unifi_uap_ac_pro_gym
  - type: custom:auto-entities
    card:
      type: entities
      card_mod:
        style: |
          ha-card {
            box-shadow: none;
            margin: -8px -16px;
          }
    show_empty: false
    filter:
      include:
        - entity_id: device_tracker.unifi_ae_*
          options:
            secondary_info: last-changed
    sort:
      method: state
  - type: custom:fold-entity-row
    head:
      type: section
      label: Unifi protect
    padding: 0
    entities:
      - type: custom:auto-entities
        card:
          type: entities
          card_mod:
            style: |
              ha-card {
                margin: 0px -16px;
              }
        filter:
          include:
            - entity_id: sensor.udm_pro_*

too. But that is all really besides the point I was making.

fold-entity-row inside an auto-entities card using entities for card.... no big deal.

Ill let Thomas decide whether this is worth inspecting, or closing.