Skip to content

Device DSL

Riff edited this page Aug 4, 2022 · 1 revision

To help controlling the device in a more script way, we provided a simple DSL to help send commands to the device in batch.

Since all commands are batched and pushed to device in one shot and the device will only return a global error code without any details, we only support write commands and doesn't support read commands like getting current channel.

And here are the example of all commands.

Channel commands

# channel set <channel-type>
channel set clock
channel set cloud
channel set visualizer
channel set customPage

# channel set-clock <clock-id>
channel set-clock 100

# channel set-cloud-channel <cloud-channel-type>
channel set-cloud-channel gallery
channel set-cloud-channel fav
channel set-cloud-channel artist

# channel set-custom-page <page-id>
channel set-custom-page 2

# channel set-visualizer <visualizer-id>
channel set-visualizer 5

System commands

# system set-brightness <brightness>
system set-brightness 80

# system set-time <unit-timestamp-in-seconds>
system set-time 10000

# system set-high-light-mode <on|off>
system set-high-light-mode on

# system set-hour-mode <12h|24h>
system set-hour-mode 12h

# system set-mirror-mode <on|off>
system set-mirror-mode on

# system set-rotation-angle <0|90|180|270>
system set-rotation-angle 90

# system set-screen-power-state <on|off>
system set-screen-power-state off

# system set-temperature-unit <c|f>
system set-temperature-unit c

# system set-time-zone <time-zone>
system set-time-zone "America/Los Angeles"

# system set-weather-area <latitude> <longitude>
system set-weather-area "-122.0" 47.0

# system set-white-balance <r> <g> <b>
system set-white-balance 100 150 200

Tool commands

# tool countdown <start|stop> [minutes] [seconds]
tool countdown start 10 30
tool countdown stop

# tool noise <start|stop>
tool noise start

# tool scoreboard <blue-score> <red-score>
tool scoreboard 1 2

# tool stopwatch <start|stop|reset>
tool stopwatch start

# tool buzzer [total-time-in-ms] [-a <active-time-in-ms>] [-o <off-time-after-active-in-ms>]
tool buzzer
tool buzzer 500 -a 100 -o 200

Animation

# animation gif play [--file <file-path>] [--folder <folder-path>] [--url <url>]
animation gif play --file d:\\1.gif
animation gif play --folder d:\\1
animation gif play --url http://example.com/1.gif

# animation image reset-id
animation image reset-id

# animation text clear
animation text clear

# animation text set <id> <text> [-x <x>] [-y <y>] [-d <left|right>] [-f <font-id>] [-w <width>] [-r <red>] [-g <green>] [-b <blue>] [-a <left|middle|right>]
animation text set 0 "test string" -x 0 -y 0 -d left -f 1 -w 32 -r 100 -g 150 -b 150 -a middle

Batch commands

# batch run-url <url-with-raw-command-payload>
batch run-url http://example.com/commands.txt

Invoke raw commands

# raw <command-payload>
raw "{ \"Command\": \"Tools/SetStopWatch\", \"Status\": 1 }"
Clone this wiki locally