Lights & show
Like, ban or tune an effect
PATCH
/api/effects/{id}Guest 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.pref: 1 likes it and -1 bans it for automatic mode (0: neither). params sets its speed, intensity, hue, saturation and mirror; params: null resets them.
Path parameters
idstringrequiredAn effect id.
Request body application/json
prefinteger1 like, -1 ban, 0 neither.
One of
1 0 -1paramsobject | nullResponses
200OKapplication/json
idstringprefintegerparamsobject | null403Locked, or not allowed.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
404No such id.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
Request
curl -X PATCH 'http://localhost:8080/api/effects/laser' \
-H 'content-type: application/json' \
-d '{
"pref": 1
}'const res = await fetch("http://localhost:8080/api/effects/laser", {
method: "PATCH",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"pref": 1
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.patch(
"http://localhost:8080/api/effects/laser",
json={
"pref": 1
},
)
print(res.json())Response
{
"id": "laser",
"pref": 1,
"params": null
}{
"error": "Settings are locked. Unlock with the PIN in Settings."
}{
"error": "Unknown effect \"x\""
}