Lights & show
Change the show
PATCH
/api/showGuest area “effects”. Open unless a PIN lock is set and guests aren't allowed this area (
settings.guest.effects); then it needs an unlock token.Changes any of the mode, effect, style, palette, how often effects change, speed and the accent layer. Setting effect alone switches to manual mode. Answers the show.
Request body application/json
modestringOne of
"auto" "manual"effectstringAn effect id. Setting it alone switches to manual mode.
stylestringauto or a style id.
palettestringA palette id.
everyBeatsinteger1 to 64speednumber0.1 to 4layerobject | nullResponses
200OKapplication/json
powerbooleanThe lights are on.
modestringauto picks effects from the music; manual keeps effect.
One of
"auto" "manual"effectstringThe effect shown in manual mode.
stylestringauto or a style id (party, chill, …).
palettestringauto or a palette id (sunset, ocean, …).
everyBeatsintegerAutomatic mode changes effect at most every this many beats, 1 to 64.
1 to 64speednumber0.1 to 4.
0.1 to 4paramsmap of objectPer-effect settings, by effect id.
layerobject | null400The body isn't valid JSON, or a value is wrong.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
403Locked, or not allowed.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
Request
curl -X PATCH 'http://localhost:8080/api/show' \
-H 'content-type: application/json' \
-d '{
"effect": "laser"
}'const res = await fetch("http://localhost:8080/api/show", {
method: "PATCH",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"effect": "laser"
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.patch(
"http://localhost:8080/api/show",
json={
"effect": "laser"
},
)
print(res.json())Response
{
"power": true,
"mode": "auto",
"effect": "shock",
"style": "auto",
"palette": "auto",
"everyBeats": 8,
"speed": 1,
"params": {},
"layer": null
}{
"error": "Unknown effect \"x\""
}{
"error": "Settings are locked. Unlock with the PIN in Settings."
}