API — الأتمتة (Automations)
قائمة الأتمتة
GET /api/v1/automations
إنشاء أتمتة
POST /api/v1/automations
Content-Type: application/json
{
"name": "إطفاء ليلي",
"is_active": true,
"trigger_type": "time",
"trigger_config": {
"time": "22:00",
"days": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]
},
"action_type": "scene",
"action_config": {
"scene_id": 1
}
}
محفّز جهاز
{
"trigger_type": "device",
"trigger_config": {
"device_id": 3,
"status": "online"
},
"action_type": "device",
"action_config": {
"device_id": 5,
"action": "off"
}
}
تحديث / حذف
PUT /api/v1/automations/{id}
DELETE /api/v1/automations/{id}
ملاحظات
- الأتمتة الزمنية تُقيَّم كل دقيقة على الخادم
is_active: falseيوقف التنفيذ دون حذف القاعدة