Deploy via script

I would like to edit my patterns in an editor like Visual Studio and then deploy via a shell script. Is that possible? I tried looking at the network traffic in Chrome Dev Tools, but there is none.

Check out this thread for starters:

Thanks! That is read-only AFAIK. So far I have not seen a method to upload a pattern script to the Pixelblaze, or am I missing something?

I think you want GitHub - zranger1/pixelblaze-client: Python 3 module for controlling Pixelblaze

Oh! Wait! I see, there isn’t such a thing in that library. @zranger1 it must be possible! :smiley:

I agree to @sorceror :slight_smile:

@pixie’s management stuff is really nice. As far as full Visual Studio/VS Code integration, it’s challenging because of the way the Pixelblaze works. Compilation to byte code (and feedback about errors) happens roughly in real-time in the browser as you type. There’s no external compiler, and as far as I know, no sanctioned way to send text to the IDE’s edit control to be compiled.

Just off the top of my head, one decent way to do it would be with an IDE plugin that had enough browser emulation to fake the Pixelblaze into thinking a user was driving.

If you have access to the page:

editor.setValue("//hello", -1)

That plops the code in the editor, compiles it, and starts generating saved preview frames (assuming no errors). Getting the pattern saved/installed involves a bit more, you need to name it and click Save (or calling tryToSave() in the page).

You could use something like selenium to script the whole upload + save process, basically having it drive a browser window for you. There isn’t a supported method for compiling patterns outside of the browser.

If websocket frames aren’t showing up, you may need to reload the page with the console up. At least chrome doesn’t seem to show pre-existing websocket connections when you open the console, only new ones.

1 Like