Layouts
Các tài nguyên Lighting giao tiếp với canvas và các hiệu ứng đang phát hiện tại. Tại đây bạn có thể xem hiệu ứng hiện tại, thay đổi nó, thay đổi preset của nó hoặc lặp qua tất cả các hiệu ứng được cài đặt của người dùng.
| Phương thức | Endpoint |
|---|---|
| GET | scenes/current_layout |
| PATCH | scenes/current_layout |
| GET | scenes/layouts |
Lấy layout hiện tại
Phần tiêu đề “Lấy layout hiện tại”Lấy thông tin về layout hiện tại.
curl http://localhost:16038/api/v1/scenes/current_layout{ "api_version": "1.0", "data": { "current_layout": { "id": "My Layout 1", "type": "layout" } }, "id": 10, "method": "/api/v1/scenes/current_layout", "params": {}, "status": "ok"}Đặt layout hiện tại
Phần tiêu đề “Đặt layout hiện tại”Đặt layout hiện đang hoạt động.
curl -X PATCH -d "{\"layout\":\"My Layout 1\"}" http://localhost:16038/api/v1/scenes/current_layout{ "api_version": "1.0", "data": { "current_layout": { "id": "My Layout 1", "type": "layout" } }, "id": 3, "method": "/api/v1/scenes/current_layout", "params": { "body": { "layout": "My Layout 1" } }, "status": "ok"}Lấy tất cả layout
Phần tiêu đề “Lấy tất cả layout”Trả về danh sách tất cả các layout có sẵn của người dùng.
curl http://localhost:16038/api/v1/scenes/layouts{ "api_version": "1.0", "data": { "items": [ { "id": "My Layout 1", "type": "layout" }, { "id": "My Layout 2", "type": "layout" } ], "type": "layouts" }, "id": 11, "method": "/api/v1/scenes/layouts", "params": {}, "status": "ok"}