Websocket API to press UI buttons? [solved]

Hi,

In order to make switching patterns smoother, I’ve put them all in the same pixelblaze program, and added UI buttons to change between them.

I’d like to use physical buttons with a websocket client to control the system remotely, but saw today in the API docs that only sliders and color pickers are supported. Is that correct with the current firmware of PB?

https://electromage.com/docs/websockets-api

… I know it’s gross, but I’m considering trying to work around this by having a slider UI element, which each third of the slider corresponding to an active pattern. the Websocket client can update the slider to 15%, 50%, 85% based on which of the three buttons are pressed, and the pixelblaze script can interpret that into the active pattern to run. Is this feasible?

Thanks,
ctag

I ought to know this, but in the Python library I’m behind on firmware support – haven’t tested with any of the new controls.

I’d try calling “getControls” on your pattern and see what it returns. Until @wizard says differently, there’s a pretty good chance that it will work, and you’ll be able to use “setControls” to set those buttons by specifying the control name and sending the 0 or 1 for pressed/not pressed.

1 Like

It worked just like you said. Set the button to ‘true’ to click. Thank you!

{“controls”:{“LePP8pBhriMSufBsA”:{“triggerFireLasers”:false}}}

1 Like