Ga naar inhoud

Verlichting

Verlichtingsresources werken met het canvas en de momenteel afgespeelde effecten. Hier kunt u het huidige effect bekijken, het wijzigen, de preset ervan wijzigen of door alle momenteel geïnstalleerde effecten van de gebruiker bladeren.

MethodeEindpunt
GETlighting
PATCHlighting/global_brightness
PATCHlighting/enabled
GETlighting/effects
GETlighting/effect/:id
GETlighting/effect/:id/presets
PATCHlighting/effect/:id/presets
POSTlighting/effect/:id/apply
GETlighting/next
POSTlighting/next
GETlighting/previous
POSTlighting/previous
POSTlighting/shuffle

Haalt informatie op over het momenteel afgespeelde effect, globale helderheid en afspeelstatus van het canvas. De self-link kan worden gebruikt om meer informatie over dit effect te verkrijgen indien gewenst.

Terminal window
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"
}

Stelt de huidige globale helderheid in.

Terminal window
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"
}

Stelt in of het canvas momenteel actief is. Wanneer uitgeschakeld ontvangen alle apparaten zwart (#000000) voor alle kleurverzoeken.

Terminal window
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"
}

Retourneert een lijst van alle geïnstalleerde effecten van de gebruiker.

  • Gezien de potentiële payloadgrootte van dit eindpunt, dient het aantal aanroepen ervan te worden beperkt.
Terminal window
curl http://localhost:16038/api/v1/lighting/effects
{
"apiVersion": "1.0",
"data": {
"items": [
{
"attributes": {
"name": " Wolfenstein II: TNC"
},
"id": "-MQtFeX-o2hMR6sv8aFr",
"links": {
"apply": "/api/v1/lighting/effects/-MQtFeX-o2hMR6sv8aFr/apply",
"self": "/api/v1/lighting/effects/-MQtFeX-o2hMR6sv8aFr"
},
"type": "effect"
},
{
"attributes": {
"name": "4th Dimension"
},
"id": "-N-YhDDs2ZIGJ42azDgJ",
"links": {
"apply": "/api/v1/lighting/effects/-N-YhDDs2ZIGJ42azDgJ/apply",
"self": "/api/v1/lighting/effects/-N-YhDDs2ZIGJ42azDgJ"
},
"type": "effect"
},
...
],
"type": "effects"
},
"id": 7,
"method": "/api/v1/lighting/effects",
"params": {},
"status": "ok"
}

Retourneert gedetailleerde informatie over een specifiek effect.

  • Als de opgegeven effect-ID niet bestaat, retourneert dit eindpunt een 404-fout.
Terminal window
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"
}
{
"api_version": "1.0",
"errors": [
{
"code": "404",
"detail": "The requested effect was not found",
"title": "Not Found"
}
],
"id": 2,
"method": "/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSO",
"params": {
"id": "-Mg1qujV9F4rabJxlSO"
},
"status": "error"
}

Retourneert een lijst van beschikbare presets voor dit effect.

  • Als de opgegeven effect-ID niet bestaat, retourneert dit eindpunt een 404-fout.
Terminal window
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"
}
{
"api_version": "1.0",
"errors": [
{
"code": "404",
"detail": "The requested effect was not found",
"title": "Not Found"
}
],
"id": 4,
"method": "/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSS/presets",
"params": {
"id": "-Mg1qujV9F4rabJxlSS"
},
"status": "error"
}

Past de doeleffectpreset toe voor de opgegeven effect-ID.

  • Als de opgegeven effect-ID of preset niet bestaat, retourneert dit eindpunt een 404-fout.
Terminal window
curl -X PATCH -d "{\"preset\":\"My Fancy Preset 1\"}" http://localhost:16038/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSOS/presets

Past de opgegeven effect-ID toe als deze bestaat.

  • Als de opgegeven effect-ID niet bestaat, retourneert dit eindpunt een 404-fout.
Terminal window
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"
}
{
"api_version": "1.0",
"errors": [
{
"code": "404",
"detail": "The requested effect was not found",
"title": "Not Found"
}
],
"id": 4,
"method": "/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSS/apply",
"params": {
"id": "-Mg1qujV9F4rabJxlSS"
},
"status": "error"
}

Retourneert informatie over het volgende effect in de geschiedenis indien beschikbaar. Als de effectgeschiedenis geen volgend effect bevat, retourneert dit eindpunt een 409-fout.

Terminal window
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"
}
{
"api_version": "1.0",
"errors": [
{
"code": "409",
"detail": "Effect History doesn't contain a next effect",
"title": "No Next Effect"
}
],
"id": 24,
"method": "/api/v1/lighting/next",
"params": {},
"status": "error"
}

Simuleert een mediasnel-vooruit-bewerking op het momenteel afgespeelde effect. Als er geen volgend effect in de geschiedenis staat, kiest SignalRGB willekeurig een geïnstalleerd, niet-game-integratie, niet-developer effect.

Retourneert het nieuw toegepaste effect.

Terminal window
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"
}
{
"api_version": "1.0",
"errors": [
{
"code": "409",
"detail": "Effect History doesn't contain a next effect",
"title": "No Next Effect"
}
],
"id": 24,
"method": "/api/v1/lighting/next",
"params": {},
"status": "error"
}

Retourneert informatie over het vorige effect in de geschiedenis indien beschikbaar. Als de effectgeschiedenis geen vorig effect bevat, retourneert dit eindpunt een 409-fout.

Terminal window
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"
}
{
"api_version": "1.0",
"errors": [
{
"code": "409",
"detail": "Effect History doesn't contain a previous effect",
"title": "No Previous Effect"
}
],
"id": 15,
"method": "/api/v1/lighting/previous",
"params": {},
"status": "error"
}

Simuleert een mediaterugspoelbewerking op het momenteel afgespeelde effect. Als er geen vorig effect in de geschiedenis staat, retourneert dit een 409-fout.

Retourneert het nieuw toegepaste effect.

Terminal window
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"
}
{
"api_version": "1.0",
"errors": [
{
"code": "409",
"detail": "Effect History doesn't contain a previous effect",
"title": "No Previous Effect"
}
],
"id": 15,
"method": "/api/v1/lighting/previous",
"params": {},
"status": "error"
}

Simuleert een mediashufflebewerking op het momenteel afgespeelde effect. SignalRGB kiest willekeurig een geïnstalleerd, niet-game-integratie, niet-developer effect.

Retourneert het nieuw toegepaste effect.

Terminal window
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"
}