custom-cards / decluttering-card

🧹 Declutter your lovelace configuration with the help of this card
MIT License
373 stars 30 forks source link

Nested Variables #36

Open WillowMist opened 3 years ago

WillowMist commented 3 years ago

This isn't a bug report, but a question.

Is it possible to nest variables, both in the caller and the default? I'm guessing it isn't, but I wanted to be sure before I try to find a workaround.

Example:

default: row1:

With the idea being to call them with [[ row1.name ]]

I'm not expecting it to work, but I wanted to know if I was wrong before I try to figure out how to make it work :)

RomRider commented 3 years ago

That doesn't work unfortunately. Maybe you're better off using lovelace_gen with that kind of use case 😊

WillowMist commented 3 years ago

Hmm, that has potential. If I'm reading right, I could use lovelace_gen to iterate through sets of variables, and use them to generate decluttering-cards, or am I completely off my rocker?

RomRider commented 3 years ago

Something like that, or even replace decluttering-card altogether with lovelace_gen for that use case

WillowMist commented 3 years ago

I can try :) I know nothing about Jinja2, yet.