Lights & show
Turn the lights on or off
POST
/api/powerGuest area “brightness”. Open unless a PIN lock is set and guests aren't allowed this area (
settings.guest.brightness); then it needs an unlock token.Turns the lights on or off; with no body, toggles them. Answers the show.
Request body application/json optional
onbooleanLeft out: toggle.
Responses
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 | null403Locked, or not allowed.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
Request
curl -X POST 'http://localhost:8080/api/power' \
-H 'content-type: application/json' \
-d '{
"on": true
}'const res = await fetch("http://localhost:8080/api/power", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"on": true
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"http://localhost:8080/api/power",
json={
"on": True
},
)
print(res.json())Response
{
"power": true,
"mode": "auto",
"effect": "shock",
"style": "auto",
"palette": "auto",
"everyBeats": 8,
"speed": 1,
"params": {},
"layer": null
}{
"error": "Settings are locked. Unlock with the PIN in Settings."
}