الوصف
توفّر بنية التشغيل الآلي جميع سلوكيات التشغيل الآلي. وقد يحتوي على عدة إجراءات آلية فرعية تعمل معًا.
الحقول
المفتاح | النوع | الوصف |
---|---|---|
name
|
String |
اسم داخلي لهذا الإجراء المبرمَج ليستخدمه المطوّرون كمرجع اختياري |
starters
|
[Starter] |
إجراءات التفعيل مطلوب |
condition
|
الشرط |
الشرط العام الذي سيتم تطبيقه. اختياري |
actions
|
[الإجراء] |
إجراءات التشغيل الآلي مطلوب |
أمثلة
استخدام قاعدة تشغيل آلي واحدة: في الساعة 6 مساءً، شغِّل الإضاءة.
automations:
starters:
type: time.schedule
at: 6:00 pm
actions:
type: device.command.OnOff
devices: Light A - Living Room
on: true
استخدام عمليات تشغيل آلي متعددة في نص برمجي: * في الساعة 6 مساءً، يتم تشغيل الإضاءة. * في الساعة 11 مساءً، يتم إطفاء التلفزيون وبث رسالة "حان وقت النوم".
automations:
- name: At 6pm, turn on light.
starters:
type: time.schedule
at: 6:00 pm
actions:
type: device.command.OnOff
devices: Light A - Living Room
on: true
- name: At 11pm, turn off TV and broadcast "time to sleep"
starters:
type: time.schedule
at: 6:00 pm
actions:
- type: device.command.OnOff
devices: TV - Living Room
on: false
- type: assistant.command.Broadcast
message: time to sleep