AalianKhan / mushroom-strategy

A strategy to automatically generate a dashboard using mushroom cards
MIT License
396 stars 38 forks source link

Templates using the states object don't work for entities starting with a number. #2

Closed DigiLive closed 1 year ago

DigiLive commented 1 year ago

If having entities, starting with a number, the template string itself is rendered. E.g. {% set switches = [states.switch.1_entity,states.switch.entity_2] %} {{ switches | selectattr('state','eq','on') | list | count }}

where states.switch.1_entity isn't valid, and should be states.switch['1_entity'].

See https://www.home-assistant.io/docs/configuration/templating/#entity_id-that-begins-with-a-number for more information on this.

I seems like the states.switch['entity'] syntax is valid for any entity.

AalianKhan commented 1 year ago

Thanks just fixed and released

3