فهرست منبع

Make config more similiar to lx-10

Ewan Dank 2 سال پیش
والد
کامیت
26da020344
1فایلهای تغییر یافته به همراه31 افزوده شده و 20 حذف شده
  1. 31 20
      custom_components/tuya_local/devices/kogan_lx8_vacuum.yaml

+ 31 - 20
custom_components/tuya_local/devices/kogan_lx8_vacuum.yaml

@@ -16,18 +16,22 @@ primary_entity:
       type: string
       optional: true
       mapping:
-        - value: pause
-        - value_redirect: pause
-        - dps_val: smart
-          value: smart
-        - dps_val: pose
-          value: clean_spot
-        - dps_val: zone
-          value: zone
-        - dps_val: backcharge
-          value: return_to_base
+        - constraint: pause
+          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
     - id: 105
-      name: status # robot_state
+      name: status  # robot_state
       type: string
       mapping:
         - dps_val: idle
@@ -52,11 +56,8 @@ primary_entity:
           value: charged
         - dps_val: remotectl
           value: remotectl
-    - id: 106
-      name: battery
-      type: integer
     - id: 109
-      name: fan_speed # fan_mode
+      name: fan_speed  # fan_mode
       type: string
       mapping:
         - dps_val: quiet
@@ -66,7 +67,7 @@ primary_entity:
         - dps_val: standard
           value: standard
     - id: 111
-      name: direction_control # remote_ctrl
+      name: direction_control  # remote_ctrl
       optional: true
       type: string
       mapping:
@@ -81,17 +82,19 @@ primary_entity:
         - dps_val: stop
           value: stop
     - id: 112
-      name: locate # seek_robot
+      name: locate  # seek_robot
       optional: true
       type: boolean
     - id: 122
-      name: error # robot_fault
+      name: error  # robot_fault
       type: bitfield
       mapping:
-        - dps_val: 0
-          value: 0
+        - dps_val: 2
+          value: Battery low
         - dps_val: 32
           value: Drop sensor abnormal
+        - dps_val: 4096
+          value: Abnormal main brush
         - dps_val: 524288
           value: Machine trapped
         - dps_val: 1048576
@@ -143,6 +146,14 @@ secondary_entities:
       - id: 103
         name: switch
         type: boolean
+  - entity: sensor
+    class: battery
+    dps:
+      - id: 106
+        type: integer
+        name: sensor
+        unit: "%"
+        class: measurement
   - entity: sensor
     name: Current clean time
     category: diagnostic