Was there a simpler solution?

I wanted to change some button label depending of a switch

so I set VAR{name, Kick} in the button label and in the switch I wrote :

setVar('button_eucl3_4', 'name' ,'OpenHat')

and it's working fine, but I was wondering if there is a better way to do it ?

I'd say it's the cleanest way to do it. The alternative would be writing something like this in the button's label property:


if (@{switch_id} == 1) return "Label for value 1"
else if (@{switch_id} == 2) return "Label for value 2"
else return "Default label"


I stay with my solution héhé
But thx for the alternative way.