الإضاءة
تتفاعل موارد الإضاءة مع لوحة الرسم (Canvas) والتأثيرات قيد التشغيل حاليًا. يمكنك هنا رؤية التأثير الحالي، أو تغييره، أو تغيير إعداده المسبق، أو استعراض جميع التأثيرات المثبتة حاليًا لدى المستخدم.
| الطريقة | نقطة النهاية |
|---|---|
| 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 |
الحصول على التأثير الحالي
Section titled “الحصول على التأثير الحالي”يجلب معلومات حول التأثير قيد التشغيل حاليًا، والسطوع العام، وحالة تشغيل لوحة الرسم (Canvas). يمكن استخدام الرابط self للحصول على مزيد من المعلومات حول هذا التأثير إذا رغبت في ذلك.
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"}تعيين السطوع العام
Section titled “تعيين السطوع العام”يعيّن قيمة السطوع العام الحالية.
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"}تشغيل/إيقاف لوحة الرسم مؤقتًا
Section titled “تشغيل/إيقاف لوحة الرسم مؤقتًا”يحدد ما إذا كانت لوحة الرسم (Canvas) نشطة حاليًا. عند تعطيلها، ستتلقى جميع الأجهزة اللون الأسود (#000000) لجميع طلبات الألوان.
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"}الحصول على التأثيرات المثبتة
Section titled “الحصول على التأثيرات المثبتة”يُعيد قائمة بجميع التأثيرات المثبتة لدى المستخدم.
- نظرًا لاحتمال كبر حجم البيانات التي تُعيدها نقطة النهاية هذه، ينبغي الحرص على تقليل عدد الاستدعاءات إليها.
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"}الحصول على معلومات التأثير
Section titled “الحصول على معلومات التأثير”يُعيد معلومات تفصيلية حول تأثير محدد.
- إذا لم يكن معرّف التأثير المُعطى موجودًا، فستُعيد نقطة النهاية هذه الخطأ 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"}الحصول على الإعدادات المسبقة للتأثير
Section titled “الحصول على الإعدادات المسبقة للتأثير”يُعيد قائمة بالإعدادات المسبقة المتاحة لهذا التأثير.
- إذا لم يكن معرّف التأثير المُعطى موجودًا، فستُعيد نقطة النهاية هذه الخطأ 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"}تطبيق إعداد مسبق للتأثير
Section titled “تطبيق إعداد مسبق للتأثير”يطبّق الإعداد المسبق المستهدف للتأثير ذي المعرّف المُعطى.
- إذا لم يكن معرّف التأثير أو الإعداد المسبق المُعطى موجودًا، فستُعيد نقطة النهاية هذه الخطأ 404.
curl -X PATCH -d "{\"preset\":\"My Fancy Preset 1\"}" http://localhost:16038/api/v1/lighting/effects/-Mg1qujV9F4rabJxlSOS/presetsتطبيق تأثير
Section titled “تطبيق تأثير”يطبّق التأثير ذا المعرّف المُعطى إذا كان موجودًا.
- إذا لم يكن معرّف التأثير المُعطى موجودًا، فستُعيد نقطة النهاية هذه الخطأ 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"}الحصول على التأثير التالي
Section titled “الحصول على التأثير التالي”يُعيد معلومات حول التأثير التالي في السجل إن وُجد. إذا لم يحتوِ سجل التأثيرات على تأثير تالٍ، فستُعيد نقطة النهاية هذه الخطأ 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 codeتطبيق التأثير التالي
Section titled “تطبيق التأثير التالي”يحاكي عملية التقديم السريع (Fast Forward) في الوسائط على التأثير قيد التشغيل حاليًا. إذا لم يكن هناك تأثير تالٍ في السجل، فسيختار SignalRGB عشوائيًا تأثيرًا مثبتًا ليس من تكاملات الألعاب وليس من تأثيرات المطورين.
يُعيد التأثير المطبّق حديثًا.
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"}الحصول على التأثير السابق
Section titled “الحصول على التأثير السابق”يُعيد معلومات حول التأثير السابق في السجل إن وُجد. إذا لم يحتوِ سجل التأثيرات على تأثير سابق، فستُعيد نقطة النهاية هذه الخطأ 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"}تطبيق التأثير السابق
Section titled “تطبيق التأثير السابق”يحاكي عملية الإرجاع (Rewind) في الوسائط على التأثير قيد التشغيل حاليًا. إذا لم يكن هناك تأثير سابق في السجل، فسيُعيد ذلك الخطأ 409.
يُعيد التأثير المطبّق حديثًا.
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"}تطبيق تأثير عشوائي
Section titled “تطبيق تأثير عشوائي”يحاكي عملية التشغيل العشوائي (Shuffle) في الوسائط على التأثير قيد التشغيل حاليًا. سيختار SignalRGB عشوائيًا تأثيرًا مثبتًا ليس من تكاملات الألعاب وليس من تأثيرات المطورين.
يُعيد التأثير المطبّق حديثًا.
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"}