Sfoglia il codice sorgente

Kogan LX10: flip command/pause around to simplify.

Nested mappings do not work in reverse. If the command is moved to pause,
only a condition block is needed without the nested mapping.

From review of #2032
Jason Rumney 1 anno fa
parent
commit
bfaed0f62a
1 ha cambiato i file con 17 aggiunte e 18 eliminazioni
  1. 17 18
      custom_components/tuya_local/devices/kogan_lx10_vacuum.yaml

+ 17 - 18
custom_components/tuya_local/devices/kogan_lx10_vacuum.yaml

@@ -9,27 +9,26 @@ primary_entity:
       name: activate  # clean_switch
       name: activate  # clean_switch
       type: boolean
       type: boolean
     - id: 102
     - id: 102
-      name: pause  # pause_switch
+      name: command  # pause_switch
       type: boolean
       type: boolean
-      hidden: true
-    - id: 104
-      name: command  # clean_mode
-      type: string
       mapping:
       mapping:
-        - constraint: pause
+        - dps_val: true
+          value: pause
+        - dps_val: false
+          constraint: actual_command
           conditions:
           conditions:
-            - dps_val: true
-              value: pause
-            - dps_val: false
-              mapping:
-                - dps_val: smart
-                  value: smart
-                - dps_val: pose
-                  value: clean_spot
-                - dps_val: zone
-                  value: zone
-                - dps_val: backcharge
-                  value: return_to_base
+            - dps_val: smart
+              value: smart
+            - dps_val: pose
+              value: clean_spot
+            - dps_val: zone
+              value: zone
+            - dps_val: backcharge
+              value: return_to_base
+    - id: 104
+      name: actual_command  # clean_mode
+      type: string
+      hidden: true
     - id: 105
     - id: 105
       name: status  # robot_state
       name: status  # robot_state
       type: string
       type: string