콘텐츠로 이동

조명

조명 리소스는 캔버스 및 현재 재생 중인 이펙트와 상호 작용합니다. 여기에서 현재 이펙트를 확인하고, 변경하고, 프리셋을 변경하거나, 사용자가 현재 설치한 모든 이펙트를 순회할 수 있습니다.

메서드엔드포인트
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

현재 재생 중인 이펙트, 전체 밝기, 캔버스 재생 상태에 대한 정보를 가져옵니다. self 링크를 사용하여 이 이펙트에 대한 추가 정보를 가져올 수 있습니다.

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

현재 전체 밝기를 설정합니다.

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

캔버스가 현재 활성 상태인지 설정합니다. 비활성화되면 모든 장치는 모든 색상 요청에 대해 검정색(#000000)을 수신합니다.

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

사용자가 설치한 모든 이펙트 목록을 반환합니다.

  • 이 엔드포인트의 잠재적인 페이로드 크기를 고려하여 호출 횟수를 줄이는 것이 좋습니다.
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"
}

특정 이펙트에 대한 상세 정보를 반환합니다.

  • 지정한 이펙트 id가 존재하지 않으면 이 엔드포인트는 404 오류를 반환합니다.
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"
}

이 이펙트에 사용 가능한 프리셋 목록을 반환합니다.

  • 지정한 이펙트 id가 존재하지 않으면 이 엔드포인트는 404 오류를 반환합니다.
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"
}

지정한 이펙트 id에 대한 대상 이펙트 프리셋을 적용합니다.

  • 지정한 이펙트 id 또는 프리셋이 존재하지 않으면 이 엔드포인트는 404 오류를 반환합니다.
Terminal window
curl -X PATCH -d "{\"preset\":\"My Fancy Preset 1\"}" http://localhost:16038/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSOS/presets

지정한 이펙트 id가 존재하는 경우 해당 이펙트를 적용합니다.

  • 지정한 이펙트 id가 존재하지 않으면 이 엔드포인트는 404 오류를 반환합니다.
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"
}

기록에서 다음 이펙트가 있는 경우 해당 이펙트에 대한 정보를 반환합니다. 이펙트 기록에 다음 이펙트가 없으면 이 엔드포인트는 409 오류를 반환합니다.

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

현재 재생 중인 이펙트에 대해 미디어 빨리 감기 작업을 수행합니다. 기록에 다음 이펙트가 없으면 SignalRGB는 설치된 무작위 이펙트(게임 통합 및 개발자 이펙트 제외)를 셔플하여 재생합니다.

새로 적용된 이펙트를 반환합니다.

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

기록에서 이전 이펙트가 있는 경우 해당 이펙트에 대한 정보를 반환합니다. 이펙트 기록에 이전 이펙트가 없으면 이 엔드포인트는 409 오류를 반환합니다.

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

현재 재생 중인 이펙트에 대해 미디어 되감기 작업을 수행합니다. 기록에 이전 이펙트가 없으면 409 오류를 반환합니다.

새로 적용된 이펙트를 반환합니다.

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

현재 재생 중인 이펙트에 대해 미디어 셔플 작업을 수행합니다. SignalRGB는 설치된 무작위 이펙트(게임 통합 및 개발자 이펙트 제외)를 셔플하여 재생합니다.

새로 적용된 이펙트를 반환합니다.

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