Open ajma opened 2 years ago
The code is wrong. A proper code is clearly described in the docs.
type: entities
entities:
- type: custom:auto-entities
filter:
include:
- group: # add group sensor
# add whatever you want
card:
type: custom:fold-entity-row
head:
entity: # add your entity
secondary_info: last-changed
group_config:
secondary_info: last-changed
But doesn't that make everything in the auto-entities list a fold-entity-row? I only want that single group to be a fold-entity-row. My code almost works, it does everything except show secondary-info in the head
My code almost works, it does everything except show secondary-info in the head
It cannot work. Check your code:
options:
type: custom:fold-entity-row
head:
entity: light.downstairs
which means - each row in the Entities card is fold-entity-row
with some head
and undefined folded entities
.
You may do this:
type: custom:auto-entities
filter:
include:
- group: group.demo_lights
card:
type: entities
which creates just a list of entities, w/o fold-entity-row
.
I only want that single group to be a fold-entity-row
then just add these entities after your auto generated fold-entity-row
Here's what I have:
groups.lock is just there to show that I'm using auto-entities to expand other groups into normal entities but light.downstairs is expanded into the three rooms which are each fold-entity-row where the children have the secondary-info but I can't figure out the yaml to make the head also show secondary-info
The last example in the readmd has this:
type: custom:auto-entities
card:
type: entities
title: All groups
filter:
include:
- domain: group
options:
type: custom:fold-entity-row
I'm basically trying to use this but also set the secondary-info
in the head
but it looks like head is getting completely dropped.
Even if I do
head:
type: section
label: test
it doesn't keep label. I'm starting to wonder if this is an auto-entities issue.
Ok, so I looked at the code and my current hypothesis is that it's because of https://github.com/thomasloven/lovelace-fold-entity-row/blob/master/src/main.ts#L54 which is let head = ensureObject(this._config.entity || this._config.head);
. My hypothesis is that auto-entities is setting _config.entity, so the head is getting ignored. I'll see if I can setup a dev environment and test it out.
Ok, I tested it and it turned out to be right. I submitted a PR.
My Home Assistant version: 2021.09.7
Fold-entity-row version (FROM BROWSER CONSOLE): 20.0.12
What I am doing: Trying to set
head
inside aauto-entities
group filterWhat I expected to happen: entity shows up with secondary-info in the head
What happened instead: secondary-info isn't showing up. the entities inside the group are showing up with the right state but without the secondary info
Minimal steps to reproduce:
Error messages from the browser console:
By putting an X in the boxes ([X]) below, I indicate that I: