浏览代码

shuffle button

Karl Hudgell 6 月之前
父节点
当前提交
cd10380d1a
共有 1 个文件被更改,包括 18 次插入0 次删除
  1. 18 0
      home_assistant_automation.yaml

+ 18 - 0
home_assistant_automation.yaml

@@ -34,6 +34,12 @@ trigger:
     id: RADIO
     to: RADIO
     enabled: true
+  - platform: state
+    entity_id:
+      - sensor.floppy_player_device_status
+    id: SHUFFLE
+    to: SHUFFLE
+    enabled: true
 condition: []
 action:
   - if:
@@ -105,4 +111,16 @@ action:
           entity_id:
             - media_player.ytube_music_player
         data: {}
+  - alias: Shuffle
+    if:
+      - condition: trigger
+        id:
+          - SHUFFLE
+    then:
+      - service: media_player.shuffle_set
+        target:
+          entity_id:
+            - media_player.ytube_music_player
+        data:
+          shuffle: false
 mode: single