Просмотр исходного кода

TTEC vacuum: rearrange dps 1 to 3

- dp 1 labelled switch_go in Tuya docs. Seems this should be activate, not power.
- dp 2 labelled pause in Tuya docs. Assume this works in combination with dp 1 as push buttons doing the opposite thing - combine into activate attribute.
- dp 3 since dp 1 is no longer marked as the power dp, this can become the power
dp (it is marked as charge_go, which implies it controls power to the charging)

Issue #1545
Jason Rumney 2 лет назад
Родитель
Сommit
879c257bb1
1 измененных файлов с 22 добавлено и 20 удалено
  1. 22 20
      custom_components/tuya_local/devices/ttec_reobipro_vacuum.yaml

+ 22 - 20
custom_components/tuya_local/devices/ttec_reobipro_vacuum.yaml

@@ -5,7 +5,7 @@ products:
 primary_entity:
   entity: vacuum
   dps:
-    - id: 1
+    - id: 3
       type: boolean
       name: power
       optional: true
@@ -13,18 +13,33 @@ primary_entity:
         - dps_val: null
           value: false
           hidden: true
-    - id: 2
+    - id: 1
       type: boolean
-      optional: true
       name: activate
+      optional: true
       mapping:
-        - dps_val: true
-          value: false
         - dps_val: false
-          value: true
+          constraint: pause
+          conditions:
+            - dps_val: true
+              value: false
+            - value: false
+              hidden: true
+        - dps_val: true
+          constraint: pause
+          conditions:
+            - dps_val: false
+              value: true
+            - value: true
+              hidden: true
         - dps_val: null
-          value: true
+          value: false
           hidden: true
+    - id: 2
+      type: boolean
+      optional: true
+      name: pause
+      hidden: true
     - id: 4
       type: string
       name: command
@@ -147,19 +162,6 @@ primary_entity:
       optional: true
       name: voice_data
 secondary_entities:
-  - entity: switch
-    name: Charge
-    icon: "mdi:lightning-bolt"
-    category: config
-    dps:
-      - id: 3
-        type: boolean
-        name: switch
-        optional: true
-        mapping:
-          - dps_val: null
-            value: false
-            hidden: true
   - entity: sensor
     name: Cleaning time
     class: duration