gadgetchnnel / lovelace-card-templater

Custom Lovelace card which allows Jinja2 templates to be applied to other cards
121 stars 6 forks source link

0.118 broke list templating ? #32

Closed Salamandar closed 4 years ago

Salamandar commented 4 years ago

Here my setup. It worked fine in 0.117… :'(

type: 'custom:card-templater'
entities:
  - group.zigbee_batterie
card:
  type: 'custom:mini-graph-card'
  name: Batteries Zigbee sur 1 mois
  entities_template: >-
    {{ "group.zigbee_batteries" | expand | sort(attribute="state") |
    map(attribute='entity_id') | list }}
  hours_to_show: 720
  points_per_hour: 0.1
  line_width: 2
  hour24: true
  lower_bound: ~0

Here's the message I get :

Please provide the "entities" option as a list. See https://github.com/kalkih/mini-graph-card/blob/master/README.md

type: 'custom:mini-graph-card'
name: Batteries Zigbee sur 1 mois
entities: >-
  sensor.porte_terrasse_power,sensor.weather_chambre_power,sensor.weather_terrasse_power,sensor.remote_tradfri_bureau_power,sensor.weather_salon_power,sensor.weather_bureau_power
hours_to_show: 720
points_per_hour: 0.1
line_width: 2
hour24: true
lower_bound: ~0

So it looks like the template kinda works but does not output a format that the entities dict value understands… Sorry, that's the second issue I open about 0.118 :D

EDIT : I also tried the tojson filter, but same issue.

Salamandar commented 4 years ago

Up ? ^^

gadgetchnnel commented 4 years ago

I've just released a new version (0.0.16) with improved support for native types in templates. Can you please try updating to that and see if it fixes it for you?

Salamandar commented 4 years ago

You're amazingly efficient. That works, thanks a lot !