Closed thelefty closed 2 years ago
What do you mean by "sync"?
Ohhhh, you mean the "sync" button in the UI? Yeah, that should be doable.
See https://github.com/Aircoookie/WLED/wiki/JSON-API, looks like "udpn.send" and "udpn.recv" need to be set to true.
Sample JSON when the button is on in the UI:
{"on":false,"bri":128,"transition":7,"ps":-1,"pss":3,"pl":-1,"ccnf":{"min":1,"max":5,"time":12},"nl":{"on":false,"dur":60,"fade":true,"tbri":0},"udpn":{"send":true,"recv":true},"lor":0,"mainseg":0,"seg":[{"id":0,"start":0,"stop":449,"len":449,"grp":1,"spc":0,"on":true,"bri":255,"col":[[255,255,255],[255,255,255],[255,255,255]],"fx":1,"sx":128,"ix":128,"pal":18,"sel":true,"rev":false}]}
Sample JSON when the button is off in the UI:
{"on":false,"bri":128,"transition":7,"ps":-1,"pss":3,"pl":-1,"ccnf":{"min":1,"max":5,"time":12},"nl":{"on":false,"dur":60,"fade":true,"tbri":0},"udpn":{"send":false,"recv":true},"lor":0,"mainseg":0,"seg":[{"id":0,"start":0,"stop":449,"len":449,"grp":1,"spc":0,"on":true,"bri":255,"col":[[255,255,255],[255,255,255],[255,255,255]],"fx":1,"sx":128,"ix":128,"pal":18,"sel":true,"rev":false}]}
The udpn.recv
setting should be independent, so this winds up being two dropdowns, one for send and one for receive: on, off, and toggle.
I've updated to 2.2 but i'm not seeing dropdowns for these in the ui? Am I missing something?
I haven't pushed the changes yet, the above comment was just notes for me on how to implement it. Sorry that wasn't clear.
I got as far as having the UI controls added but then got stuck. It's going to require quite a bit of code refactoring to make it clean and not rely on copying and pasting a ton of code multiple times. I'll try digging into it more next weekend.
Closing old issues.
Is there a way we can have sync on/off/toggle as one of the settings? That would be nice and would allow for more fine tuning of syncing and the turning syncing off. Would be great.