I’ve been very busy recently with a complete rewrite of most of my HA config and I’ve gotten so tired of Jinja2 that I need to write this topic.
In the python world Jinja2 is the de facto standard, but it pales in comparison to Ruby’s ERB. The latter being a templating engine that can evaluate raw ruby code and supports template partials (imaging being able to pass variables to a template ). It would make using templates so much more powerful and enjoyable.
I wouldn’t mind a templating engine that can evaluate raw python code – anything to get rid of jinja2 – but AFAIK that’s not really a thing?
I know it won’t be a popular suggestion in a pthon project, but if we could have a Ruby API and template renderer that would be great. For the Ruby API: it’s very easy to directly call python code from ruby, so that shouldn’t be a big effort
My mistake, that part was a bit ignorant regarding jinja. The core of my suggestion is about having the power of a full programming language in templates. It’s very much comparable with ESPHome where one can add straightforward C++ lambdas instead of having to juggle with a pseudo-language.