Éclairage
Les ressources d’éclairage interagissent avec le canvas et les effets en cours de lecture. Vous pouvez ici consulter l’effet actuel, le modifier, changer son préréglage, ou parcourir tous les effets installés pour l’utilisateur.
| Méthode | Point de terminaison |
|---|---|
| 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 |
Obtenir l’effet actuel
Section intitulée « Obtenir l’effet actuel »Récupère des informations sur l’effet en cours de lecture, la luminosité globale et l’état de lecture du canvas. Le lien self peut être utilisé pour obtenir davantage d’informations sur cet effet si souhaité.
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"}Définir la luminosité globale
Section intitulée « Définir la luminosité globale »Définit la luminosité globale actuelle.
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"}Lecture/Pause du canvas
Section intitulée « Lecture/Pause du canvas »Définit si le canvas est actuellement actif. Lorsqu’il est désactivé, tous les périphériques recevront la couleur noire (#000000) pour toutes les requêtes de couleur.
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"}Obtenir les effets installés
Section intitulée « Obtenir les effets installés »Retourne la liste de tous les effets installés par l’utilisateur.
- Compte tenu de la taille potentielle de la charge utile de ce point de terminaison, il convient de limiter le nombre d’appels à celui-ci.
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"}Obtenir les informations d’un effet
Section intitulée « Obtenir les informations d’un effet »Retourne des informations détaillées sur un effet spécifique.
- Si l’identifiant d’effet fourni n’existe pas, ce point de terminaison retournera une erreur 404.
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"}Obtenir les préréglages d’un effet
Section intitulée « Obtenir les préréglages d’un effet »Retourne la liste des préréglages disponibles pour cet effet.
- Si l’identifiant d’effet fourni n’existe pas, ce point de terminaison retournera une erreur 404.
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"}Appliquer un préréglage d’effet
Section intitulée « Appliquer un préréglage d’effet »Applique le préréglage d’effet cible pour l’identifiant d’effet donné.
- Si l’identifiant d’effet ou le préréglage fourni n’existe pas, ce point de terminaison retournera une erreur 404.
curl -X PATCH -d "{\"preset\":\"My Fancy Preset 1\"}" http://localhost:16038/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSOS/presetsAppliquer un effet
Section intitulée « Appliquer un effet »Applique l’identifiant d’effet donné s’il existe.
- Si l’identifiant d’effet fourni n’existe pas, ce point de terminaison retournera une erreur 404.
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"}Obtenir l’effet suivant
Section intitulée « Obtenir l’effet suivant »Retourne des informations sur l’effet suivant dans l’historique s’il est disponible. Si l’historique des effets ne contient pas d’effet suivant, ce point de terminaison retournera une erreur 409.
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"}// Click to edit codeAppliquer l’effet suivant
Section intitulée « Appliquer l’effet suivant »Reproduit une opération d’avance rapide sur l’effet en cours de lecture. Si l’historique ne contient pas d’effet suivant, SignalRGB choisira aléatoirement un effet installé qui n’est ni une intégration de jeu ni un effet développeur.
Retourne l’effet nouvellement appliqué.
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"}Obtenir l’effet précédent
Section intitulée « Obtenir l’effet précédent »Retourne des informations sur l’effet précédent dans l’historique s’il est disponible. Si l’historique des effets ne contient pas d’effet précédent, ce point de terminaison retournera une erreur 409.
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"}Appliquer l’effet précédent
Section intitulée « Appliquer l’effet précédent »Reproduit une opération de rembobinage sur l’effet en cours de lecture. Si l’historique ne contient pas d’effet précédent, cette opération retournera une erreur 409.
Retourne l’effet nouvellement appliqué.
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"}Appliquer un effet aléatoire
Section intitulée « Appliquer un effet aléatoire »Reproduit une opération de lecture aléatoire sur l’effet en cours de lecture. SignalRGB choisira aléatoirement un effet installé qui n’est ni une intégration de jeu ni un effet développeur.
Retourne l’effet nouvellement appliqué.
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"}