Преглед изворни кода

Lefant N3: juggle power_go and pause dps

- mark 4, 6, 7, 126 as optional, as they seem to not appear for another user
- based on reported behaviour, try power_go as power, pause as activate inverted.
I think this was already tried for TTEC vacuum and did not work there, but maybe
the vacuums act differently.
- based on commands not seeming to work, make them also trigger power and switch_charge dps as appropriate.

Issue #1393
Jason Rumney пре 2 година
родитељ
комит
a7becc17b4
1 измењених фајлова са 38 додато и 6 уклоњено
  1. 38 6
      custom_components/tuya_local/devices/lefant_n3_vacuum.yaml

+ 38 - 6
custom_components/tuya_local/devices/lefant_n3_vacuum.yaml

@@ -8,22 +8,51 @@ primary_entity:
   entity: vacuum
   dps:
     - id: 1
+      name: power
+      type: boolean
+    - id: 2
       name: activate
       type: boolean
+      mapping:
+        - dps_val: true
+          value: false
+        - dps_val: false
+          value: true
+    - id: 3
+      name: switch_charge
+      type: boolean
+      optional: true
+      hidden: true
     - id: 4
-      name: command
+      name: work_mode
       type: string
+      optional: true
       mapping:
         - dps_val: smart
-          value: clean
+          conditions: power
+          constraint:
+            - dps_val: true
+              value: smart
         - dps_val: chargego
-          value: return_to_base
+          constraint: switch_charge
+          conditions:
+            - dps_val: true
+              value: return_to_base
         - dps_val: zone
-          value: clean_zone
+          constraint: power
+          conditions:
+            - dps_val: true
+              value: clean_zone
         - dps_val: pose
-          value: clean_spot
+          constraint: power
+          conditions:
+            - dps_val: true
+              value: clean_spot
         - dps_val: part
-          value: clean_partial
+          constraint: power
+          conditions:
+            - dps_val: true
+              value: clean_partial
         - dps_val: fastmapping
           value: map
         - dps_val: CleanModeSectorbased
@@ -190,6 +219,7 @@ primary_entity:
       name: scheduled_clean
     - id: 126
       type: boolean
+      optional: true
       name: map_saved
 secondary_entities:
   - entity: button
@@ -224,6 +254,7 @@ secondary_entities:
     dps:
       - id: 6
         type: integer
+        optional: true
         name: sensor
         unit: min
         class: measurement
@@ -234,6 +265,7 @@ secondary_entities:
     dps:
       - id: 7
         type: integer
+        optional: true
         name: sensor
         unit: m2
         class: measurement