Advertisement
xangin

地震分級腳本

Oct 11th, 2022 (edited)
1,239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.70 KB | None | 0 0
  1. earthquake_alert:
  2.   alias: 地震分級腳本
  3.   variables:
  4.     lv: "{{ level[:1] | int }}"
  5.   sequence:    
  6.     - choose:
  7.         - conditions:
  8.            - "{{ lv <= 3 }}"
  9.           sequence:
  10.            #當地震小於等於3級要做的事情放在此
  11.             - service: notify.line_notify
  12.               data:
  13.                 message: '警告!{{ lv }}級地震將在{{ seconds }}秒後抵達'
  14.                
  15.         - conditions:
  16.            - "{{ lv >3 }}"
  17.           sequence:
  18.            #當地震大於3級要做的事情放在此
  19.             - service: notify.line_notify
  20.               data:
  21.                 message: '警告!{{ lv }}級地震將在{{ seconds }}秒後抵達'    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement