Lighting
Lighting resources interact with the canvas and currently playing effects. Here you can see the current effect, change it, change it's preset, or iterate through all currently installed effects for the user.
Method | Endpoint |
---|---|
GET | lighting |
PATCH | lighting/global_brightness |
PATCH | lighting/enabled |
GET | lighting/effects |
GET | lighting/effect/:id |
GET | lighting/effect/:id/presets |
PATCH | lighting/effect/:id/presets |
POST | lighting/effect/:id/apply |
GET | lighting/next |
POST | lighting/next |
GET | lighting/previous |
POST | lighting/previous |
POST | lighting/shuffle |
Get Current Effect
Fetches information about the current playing effect, Global Brightness, and Canvas Play State. The self link can be used to get more information about this effect if desired.
curl http://localhost:16038/api/v1/lighting
{
"api_version": "1.0",
"data": {
"attributes": {
"enabled": true,
"global_brightness": 50,
"name": "Neon Shift"
},
"id": "Neon Shift.html",
"links": {
"self": "/api/v1/lighting/effects/Neon Shift.html"
},
"type": "current_effect"
},
"id": 6,
"method": "/api/v1/lighting",
"params": {},
"status": "ok"
}
Set Global Brightness
Sets the current Global Brightness.
curl -X PATCH -d "{\"global_brightness\":73}" http://localhost:16038/api/v1/lighting/global_brightness
{
"api_version": "1.0",
"data": {
"attributes": {
"enabled": true,
"global_brightness": 73
},
"type": "effect"
},
"id": 3,
"method": "/api/v1/lighting/global_brightness",
"params": {
"body": {
"global_brightness": 73
}
},
"status": "ok"
}
Play/Pause Canvas
Sets if the Canvas is currently active. When disabled all devices will receive black (#000000) for all color requests.
curl -X PATCH -d "{\"enabled\":false}" http://localhost:16038/api/v1/lighting/enabled
{
"api_version": "1.0",
"data": {
"attributes": {
"enabled": false,
"global_brightness": 73
},
"type": "effect"
},
"id": 4,
"method": "/api/v1/lighting/enabled",
"params": {
"body": {
"enabled": false
}
},
"status": "ok"
}
Get Installed Effects
Returns a list of all installed effects the user has.
- Given the potential payload size of this endpoint care should be taken to reduce the number of calls to it.
curl http://localhost:16038/api/v1/lighting/effects
Get Effect Information
Returns detailed information about a specific effect.
- If the given effect id doesn't exist this endpoint will return a 404 error.
curl http://localhost:16038/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSOS
{
"api_version": "1.0",
"data": {
"attributes": {
"description": "A colorful drizzle of softly moving lines.",
"developer_effect": false,
"image": "https://imagedelivery.net/uPA_EtOZxmT3DaI0aRG2mQ/-Mg1qujV9F4rabJxlSOS/main/dashcard",
"name": "Drizzle",
"parameters": {
"backColorMode": {
"label": "Background Color Mode",
"type": "combobox",
"value": "Static"
},
"backHue": {
"label": "Background Color (Static)",
"type": "color",
"value": "#320056"
},
"confHue": {
"label": "Line Color (Static)",
"type": "color",
"value": "#ff0000"
},
"confLength": {
"label": "Line Length",
"type": "number",
"value": 70
}
},
"publisher": "SignalRGB",
"uses_audio": false,
"uses_input": false,
"uses_meters": false,
"uses_video": false
},
"id": "-Mg1qujV9F4rabJxlSOS",
"links": {
"apply": "/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSOS/apply",
"self": "/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSOS"
},
"type": "effect"
},
"id": 1,
"method": "/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSOS",
"params": {
"id": "-Mg1qujV9F4rabJxlSOS"
},
"status": "ok"
}
Get Effect Presets
Returns a list of available Presets for this effect.
- If the given effect id doesn't exist this endpoint will return a 404 error.
curl http://localhost:16038/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSOS/presets
{
"api_version": "1.0",
"data": {
"id": "-Mg1qujV9F4rabJxlSOS",
"items": [
{
"id": "My Fancy Preset 1",
"type": "preset"
},
{
"id": "My Other Preset",
"type": "preset"
}
],
"type": "presets"
},
"id": 1,
"method": "/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSOS/presets",
"params": {
"id": "-Mg1qujV9F4rabJxlSOS"
},
"status": "ok"
}
Apply Effect Preset
Applies the target effect preset for the effect id given.
- If the given effect id, or preset doesn't exist this endpoint will return a 404 error.
curl -X PATCH -d "{\"preset\":\"My Fancy Preset 1\"}" http://localhost:16038/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSOS/presets
Apply Effect
Applies the given effect id if it exists.
- If the given effect id doesn't exist this endpoint will return a 404 error.
curl -X POST http://localhost:16038/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSOS/apply
{
"api_version": "1.0",
"id": 3,
"method": "/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSOS/apply",
"params": {
"id": "-Mg1qujV9F4rabJxlSOS"
},
"status": "ok"
}
Get Next Effect
Returns information about the next effect in history if available. If effect history doesn't contain a next effect then this endpoint will return a 409 error.
curl http://localhost:16038/api/v1/lighting/next
{
"api_version": "1.0",
"data": {
"attributes": {
"name": "Drizzle"
},
"id": "-Mg1qujV9F4rabJxlSOS",
"links": {
"self": "/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSOS"
},
"type": "effect"
},
"id": 5,
"method": "/api/v1/lighting/next",
"params": {},
"status": "ok"
}
Apply Next Effect
Mimics a Media Fast Forward operation on the currently playing effect. If there is no next effect in history SignalRGB will shuffle in a random installed, non-game integration, non-developer effect.
Returns the newly applied effect.
curl -X POST http://localhost:16038/api/v1/lighting/next
{
"api_version": "1.0",
"data": {
"attributes": {
"name": "Drizzle"
},
"id": "-Mg1qujV9F4rabJxlSOS",
"links": {
"self": "/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSOS"
},
"type": "effect"
},
"id": 5,
"method": "/api/v1/lighting/next",
"params": {},
"status": "ok"
}
Get Previous Effect
Returns information about the previous effect in history if available. If effect history doesn't contain a previous effect then this endpoint will return a 409 error.
curl http://localhost:16038/api/v1/lighting/previous
{
"api_version": "1.0",
"data": {
"attributes": {
"name": "Gradient Generator"
},
"id": "-MA7wCKkv_359cmwPOEK",
"links": {
"self": "/api/v1/lighting/effects/-MA7wCKkv_359cmwPOEK"
},
"type": "effect"
},
"id": 7,
"method": "/api/v1/lighting/previous",
"params": {},
"status": "ok"
}
Apply Previous Effect
Mimics a Media Rewind operation on the currently playing effect. If there is no previous effect in history this will return a 409 error.
Returns the newly applied effect.
curl -X POST http://localhost:16038/api/v1/lighting/previous
{
"api_version": "1.0",
"data": {
"attributes": {
"name": "Gradient Generator"
},
"id": "-MA7wCKkv_359cmwPOEK",
"links": {
"self": "/api/v1/lighting/effects/-MA7wCKkv_359cmwPOEK"
},
"type": "effect"
},
"id": 7,
"method": "/api/v1/lighting/previous",
"params": {},
"status": "ok"
}
Apply Random Effect
Mimics a Media Shuffle operation on the currently playing effect. SignalRGB will shuffle in a random installed, non-game integration, non-developer effect.
Returns the newly applied effect.
curl -X POST http://localhost:16038/api/v1/lighting/shuffle
{
"api_version": "1.0",
"data": {
"attributes": {
"name": "Borealis"
},
"id": "-N1LC8HkC4fZ6IlFA30j",
"links": {
"self": "/api/v1/lighting/effects/-N1LC8HkC4fZ6IlFA30j"
},
"type": "effect"
},
"id": 6,
"method": "/api/v1/lighting/shuffle",
"params": {},
"status": "ok"
}