Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow current entity state in entities without repeating entity ID #340

Open
twpol opened this issue Aug 3, 2024 · 1 comment
Open

Allow current entity state in entities without repeating entity ID #340

twpol opened this issue Aug 3, 2024 · 1 comment

Comments

@twpol
Copy link

twpol commented Aug 3, 2024

I am currently unable to show the main entity's state in the entities list without repeating the entity ID. This would normally be fine (apart from extra typing) but I don't see a way to make it work inside custom:auto-entities. I love both these extensions and would love them to work together even better. :)

In #273 (the same issue but for secondary info area), you can specify an icon as a workaround because the icon is ignored there.

This works but repeats the entity ID:

type: entities
entities:
  - entity: person.james_ross
    type: custom:multiple-entity-row
    entities:
      - entity: person.james_ross

This does not work, gives validation error: Entity object requires at least one 'entity', 'attribute' or 'icon'.

type: entities
entities:
  - entity: person.james_ross
    type: custom:multiple-entity-row
    entities:
      - {}

I can see three ways we could make this work:

  • Allow no properties (as in my example above) which would use the main entity, state, no icon - exactly as if the entity ID was the only thing specified
  • Add a special value to entity that passes validation but refers to the main entity
  • Add a special value to attribute that passes validation but refers to the state instead

I haven't been able to find any such special values in the code or documentation, but I might have missed it if they do exist. Sorry if that's the case!

@ildar170975
Copy link

ildar170975 commented Aug 3, 2024

May be I am missing something - but have you tried

  - entity: person.james_ross
    type: custom:multiple-entity-row

if you need to show this entity only.
Ofc m-e-r is supposed to be used to show multiple entities mainly; and in auto-entities you will have to use a “template” filter in many cases.

In general, you are asking a QUESTION, not reporting a bug.
So I would suggest to use a dedicated Community thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants