decluttering-card icon indicating copy to clipboard operation
decluttering-card copied to clipboard

Nested Variables

Open WillowMist opened this issue 3 years ago • 4 comments

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: - name - image

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 :)

WillowMist avatar Mar 17 '21 21:03 WillowMist

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

RomRider avatar Mar 17 '21 21:03 RomRider

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?

WillowMist avatar Mar 17 '21 21:03 WillowMist

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

RomRider avatar Mar 17 '21 21:03 RomRider

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

WillowMist avatar Mar 17 '21 22:03 WillowMist