Hello!
I am migrating a big dashboard fron v0 to v1.
One thing I am missing is the ‘show value’ option that was available for switches in v0.
Is it possbiel to have it in v1 as well?
Thanks!
Hello!
I am migrating a big dashboard fron v0 to v1.
One thing I am missing is the ‘show value’ option that was available for switches in v0.
Is it possbiel to have it in v1 as well?
Thanks!
Well it was really an edge-case feature, you should be able to display any desired label with the object syntax ({"label a": "value a", "label b": "value b", }
).
Thx for your reply.
I am using several switches to store structured data, and it was very useful to use /EDIT to alter these values, and display them at the same time, with only one widget.
You're right, I can use another widget just for the display using the ( ) syntax, but:
I use smth like:
JS{{
return JSON.stringify(@{text_5}).replace('",', '"\n');
}}
but I cannot say it's pretty
A single switch widget does the job, for instance with values
set to
{
"[1,2,3]": [ 1, 2, 3 ],
"[2,3,4]": [ 2, 3, 4 ]
}
Anyway, storing and displaying strutured data with a switch selector is typically an edge-case that can be handled many other ways and more elegantly (scripts, custom-module, or even from the controlled app).
that can be handled many other ways and more elegantly
I had found this way on v0 and I might not be aware of newest ways of doing this.
For now, I need to store structured data (key/values) where the values can be structured too.
For example {"song1": {"name":"bla", "position":5}, "song2":...}
and so on.
these attributes are used in my dashboard in different places, in order to display the different "songs" and interact with them.
Do you think I should use global variables to store this?
Or de-structure this information to have /song1/pos and /song1/name widgets?
thx for your hints