ソースを参照

TTEC vacuum: reverse logic for commands and pause

To make all commands always available, avoid use of nested mappings by
flipping the logic so the pause dp becomes the main command dp.

Issue #1509
Jason Rumney 2 年 前
コミット
28500f006b
1 ファイル変更40 行追加19 行削除
  1. 40 19
      custom_components/tuya_local/devices/ttec_reobipro_vacuum.yaml

+ 40 - 19
custom_components/tuya_local/devices/ttec_reobipro_vacuum.yaml

@@ -16,28 +16,49 @@ primary_entity:
     - id: 2
       type: boolean
       optional: true
-      name: pause
-    - id: 4
-      type: string
       name: command
       mapping:
-        - constraint: pause
+        - dps_val: true
+          value: pause
+        - dps_val: false
+          constraint: mode
+          conditions:
+            - dps_val: smart
+              value: smart
+            - dps_val: chargego
+              value: return_to_base
+            - dps_val: zone
+              value: zone
+            - dps_val: pose
+              value: clean_spot
+            - dps_val: part
+              value: partial
+            - dps_val: selectroom
+              value: room
+        - dps_val: null
+          constraint: mode
           conditions:
-            - dps_val: true
-              value: pause
-            - mapping:
-                - dps_val: smart
-                  value: smart
-                - dps_val: chargego
-                  value: return_to_base
-                - dps_val: zone
-                  value: zone
-                - dps_val: pose
-                  value: clean_spot
-                - dps_val: part
-                  value: partial
-                - dps_val: selectroom
-                  value: room
+            - dps_val: smart
+              value: smart
+              hidden: true
+            - dps_val: chargego
+              value: return_to_base
+              hidden: true
+            - dps_val: zone
+              value: zone
+              hidden: true
+            - dps_val: pose
+              value: clean_spot
+              hidden: true
+            - dps_val: part
+              value: partial
+              hidden: true
+            - dps_val: selectroom
+              value: room
+              hidden: true
+    - id: 4
+      type: string
+      name: mode
     - id: 5
       type: string
       name: status