API — المشاهد (Scenes)
قائمة المشاهد
GET /api/v1/scenes
إنشاء مشهد
POST /api/v1/scenes
Content-Type: application/json
{
"name": "مساء",
"description": "إضاءة خافتة",
"actions": [
{ "device_id": 1, "action": "on", "delay_seconds": 0 },
{ "device_id": 2, "action": "off", "delay_seconds": 2 }
]
}
تنفيذ مشهد
POST /api/v1/scenes/{id}/execute
ينفّذ كل إجراء بالتسلسل مع التأخير المحدد.
تحديث / حذف
PUT /api/v1/scenes/{id}
DELETE /api/v1/scenes/{id}
أخطاء
| Code | السبب |
|---|---|
| 404 | مشهد غير موجود |
| 422 | device_id غير صالح في actions |