Skip to content
Robert Stanley Judka edited this page Mar 3, 2021 · 17 revisions

Accepts WebSocket connections on port 54545 (thats 0xD511 [DSH] in decimal)

This service is disabled by default. It can be toggled on the Settings Page under the Main tab

API

State

allows you to read and modify the current state

  • mode : string => string
    • "Light"
    • "Dark"
  • color : string => string
    • RGB (e.g "#112233")
    • ARGB (e.g "#ff112233")
    • color name (e.g "blue")
  • page : int => int
    • index of active page
  • brightness : int => int
    • plz only set between 76 and 255 🙂
  • volume : int => int
    • plz only set between 0 and 100 🙂
  • pageX [X is the page's index] : bool => object(bool, string)
    • page availability and name
    • only availability is settable
  • pages : array of bool => array of object(bool, string, string)
    • availability, key, and name of all pages
    • only availability is settable

Action

allows you to perform an action (most likely modifying the current state in the process)

  • cycle_page : => int
  • decrease_brightness : => int
  • increase_brightness : => int
  • decrease_volume : => int
  • increase_volume : => int

Getting

send an array of keys, get an object of each key:value

action keys will perform the designated action, then return the modified state

keys can be a mix of state/action

Examples

JavaScript

let dash = new WebSocket("ws://localhost:54545");
dash.onmessage = function (event){ console.log(event.data); };
dash.send(JSON.stringify(["mode", "cycle_page", "color"]));
{
    "color": "#8bcc9f",
    "cycle_page": 1,
    "mode": "Dark"
}

Setting

send an object of each key:value to update, get each updated key:value

only supported for state keys

Examples

JavaScript

let dash = new WebSocket("ws://localhost:54545");
dash.send(JSON.stringify({"mode": "Light"}));
{
    "mode": "Light"
}
Clone this wiki locally