thomasloven / hass-lovelace_gen

🔹 Improve the lovelace yaml parser for Home Assistant
MIT License
209 stars 22 forks source link

{% %} under views doesn't work #33

Closed 50494554524F closed 2 years ago

50494554524F commented 2 years ago
# lovelace_gen
views:
  - title: ''
    path: 'temperature'
    type: 'custom:vertical-layout'
    layout:
      max_cols: 3
    icon: 'hass:thermometer'
    cards:

      - type: entities
        entities:
{% for n in [ '1', '2', '3' ] %}
          - input_boolean.test
{% endfor %}

      - !include
        - templates/template-thermometer.yaml
        - params:
            sensor_temperature: sensor.thermometer_temperature
            sensor_humidity: sensor.thermometer_humidity

the !include is rendered perfectly but the {% %} block gives this error...

2022-01-06 11:06:57 ERROR (SyncWorker_10) [homeassistant.util.yaml.loader] while scanning for the next token
found character '%' that cannot start any token
  in "/config/home/lovelace/test-views.yaml", line 255, column 2

thanks

50494554524F commented 2 years ago

workaround: i use an include