webminster Posted yesterday at 12:51 AM Posted yesterday at 12:51 AM I'd like to create a favorite that can enable/disable a behavior, using a state variable. Swear I had this work before, but now I can't replicate it. What I've tried to do in UD Mobile is to create a favorite from a state variable I have in IoX. I'm using that variable as a condition to enable a program folder. I've tried to change the properties of that node's View Type to "switch", as I'd like to create some sort of toggle. What I've seen doing this is that the switch toggle then flips the value of the state variable between -2 and +2 (depending on precision - higher precision shows like -2.14 and 2.14 for instance). I also note that the toggling isn't completely deterministic - sometimes the state of the toggle doesn't correspond to the numeric value, as in toggling the switch from 2 (on) to -2 (off) shows the switch graphic go to off, then back on, even if the value is -2. I assume this isn't a supported way to control a state variable, but is there some way to create such an effect? Thanks in advance. Quote
Solution Javi Posted yesterday at 01:07 AM Solution Posted yesterday at 01:07 AM See the custom toggle example https://wiki.universal-devices.com/index.php?title=UD_Mobile#Favorite_Custom_Toggle In short the Display Node and the Command do not need to be related, but the command should cause the Display Node to change. The command should be a Program Run IF so it holds all logic related to the toggle. Quote
webminster Posted yesterday at 02:27 AM Author Posted yesterday at 02:27 AM Thanks, that's helpful, got it working. The note about the variable/program startup refresh was good. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.