thomasloven / hass-lovelace_gen

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

whitespace indentation for macros solution #21

Open lmamakos opened 3 years ago

lmamakos commented 3 years ago

Since you can embed JSON with YAML files, one solution is to generate the equivalent JSON representation of the data structure that YAML would produce. Since the JSON structure is insensitive to indentation, this appears to be a solution to using macros in a generalized way.

See my post https://community.home-assistant.io/t/fun-with-lovelace-gen-and-jinja2-macros-to-avoid-whitespace-indentation-problems/236427 for an example.