Gh61/lovelace-hue-like-light-card

Idea: Add support for auto-entities

Closed this issue · 3 comments

Would it be possible to add support for auto-entities?

Context

Here auto entities could act as a filter, e.g. all lights in a room.

type: custom:auto-entities
filter:
  include:
    - area: bedroom
      domain: light
card_param: entities
card:
  type: entities

Results in
image

Problems

However when using this you'll get the error: Object { code: "invalid_format", message: "expected str for dictionary value @ data['item_id']. Got {'entity': 'light.signify_netherlands_b_v_lwo001_light'}" }.

Using a similiar template to cast the result from entity to string seems to get a bit further, but then crashes.

type: custom:auto-entities
filter:
  template: |
    {% for light in states.light %}
      {% if light.state == "on" %}
        {{ light.entity_id | string}},
      {% endif %}
    {% endfor %}
card_param: entities
card:
  type: custom:hue-like-light-card

Crash log

Uncaught TypeError: t is undefined
    calculateBackAndForeground hue-like-light-card.js:79
    updateStylesInner hue-like-light-card.js:937
    connectedCallback hue-like-light-card.js:945
    connectedCallback scoped-custom-element-registry.js:248
Gh61 commented

Thank you for reporting,
I'll look into it.

Gh61 commented

Resolved in the current Release.

Thanks a lot @Gh61 !