thomasloven / hass-lovelace_gen

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

invalid key: "OrderedDict([('entity', None)])" #41

Closed biiiink closed 2 years ago

biiiink commented 2 years ago

I just noticed that I am getting this error on one of my dashboards:

Logger: custom_components.lovelace_gen
Source: custom_components/lovelace_gen/__init__.py:34
Integration: Lovelace Gen ([documentation](http://192.168.20.14:8123/config/logs))
First occurred: 10:43:53 AM (19 occurrences)
Last logged: 10:53:18 AM

invalid key: "OrderedDict([('entity', None)])" in "/config/lovelace/dashboards/mobile/includes/lights.yaml", line 3, column 0

the elements im using all look like this:

            - !include
              - includes/lights.yaml
              - entity: light.back_door
                name: Back Door Light
                top: 25%
                left: 1%
                transform: "scale(1.5)"
                type: slider

And this is lights.yaml

# lovelace_gen
type: state-icon
entity: { { entity } }
icon: mdi:lightbulb
style:
  top: { { top } }
  left: { { left } }
  transform: { { transform } }
tap_action:
  action: toggle
hold_action:
  action: call-service
  service: browser_mod.popup
  service_data:
    title: { { name } }
    larger: true
    style:
      width: 100%
      height: 100%
    card:
      type: "custom:light-popup-card"
      entity: { { entity } }
      icon: mdi:lightbulb

One thing i did notice is that all of the variables are now wrapped in "{ {" instead of "{{". Not sure if this will affect anything. I did try to remove the spaces, but the Studio Code Server add-on adds the space back in when I save

biiiink commented 2 years ago

Looks like the spaces are causing an issue. This issue is with Studio Code Server add-on. Closing