homeassistant-lovelace-gen
homeassistant-lovelace-gen copied to clipboard
Global jinja2 macros
Maybe there is a better way for doing something smiliar but this works and was very easy to implement.
btw: don't be afraid of "+278 lines", most of them are examples :wink:
I have a change that I'm still experimenting with that allows the jinja import
statement to work. Then you can put the macros in a separate file of your choosing and import it as needed.
I'd love to have your examples though, but I don't think the yaml files are necessary. It's better to write a minimal example and put it all in the markdown file.
I'd be happy to ditch this hacky solution if you implement real jinja import! Until then I can live with my fork.
And feel free to use my examples. I added the individual files so that you can easily reuse them for testing.
Oh. Hi. Thanks for keeping up the work on this!
Two weeks ago, I released lovelace_gen
, which is an updated version of this that installas as a custom Home Assistant component and transparently changes the way it parses your ui_lovelace.yaml file. You may want to check that out.
https://github.com/thomasloven/hass-lovelace_gen
It still doesn't have global macros, though...