فهرست منبع

Kogan LX10: fix code review issues

from PR #725
issue #723
Jason Rumney 2 سال پیش
والد
کامیت
2ccec8cb37
1فایلهای تغییر یافته به همراه66 افزوده شده و 96 حذف شده
  1. 66 96
      custom_components/tuya_local/devices/kogan_lx10_vacuum.yaml

+ 66 - 96
custom_components/tuya_local/devices/kogan_lx10_vacuum.yaml

@@ -81,12 +81,6 @@ primary_entity:
       name: locate # seek_robot
       optional: true
       type: boolean
-    - id: 114
-      name: volume
-      type: integer
-      range:
-        min: 0
-        max: 10
     - id: 122
       name: error # robot_fault
       # TODO: correctly parse the bitfield
@@ -115,50 +109,6 @@ primary_entity:
     - id: 128
       name: message_report
       type: string
-      mapping:
-        # TODO: figure out the meanings of these
-        - dps_val: '0'
-          value: '0'
-        - dps_val: '1'
-          value: '1'
-        - dps_val: '2'
-          value: '2'
-        - dps_val: '3'
-          value: '3'
-        - dps_val: '4'
-          value: '4'
-        - dps_val: '5'
-          value: '5'
-        - dps_val: '6'
-          value: '6'
-        - dps_val: '7'
-          value: '7'
-        - dps_val: '8'
-          value: '8'
-        - dps_val: '9'
-          value: '9'
-        - dps_val: '10'
-          value: '10'
-        - dps_val: '11'
-          value: '11'
-        - dps_val: '12'
-          value: '12'
-        - dps_val: '13'
-          value: '13'
-        - dps_val: '14'
-          value: '14'
-        - dps_val: '15'
-          value: '15'
-        - dps_val: '16'
-          value: '16'
-        - dps_val: '17'
-          value: '17'
-        - dps_val: '18'
-          value: '18'
-        - dps_val: '19'
-          value: '19'
-        - dps_val: '20'
-          value: '20'
     - id: 130
       name: sn
       optional: true
@@ -173,38 +123,39 @@ primary_entity:
       type: string
 secondary_entities:
   - entity: switch
-    name: charge_switch
+    name: Charge switch
     category: config
     icon: "mdi:power-plug"
     dps:
       - id: 103
-        name: charge_switch
+        name: switch
         type: boolean
-  - entity: number
-    name: cur_clean_time
+  - entity: sensor
+    name: Current clean time
     category: diagnostic
+    class: duration
     icon: "mdi:clock-outline"
     dps:
       - id: 107
-        name: cur_clean_time
+        name: sensor
         type: integer
-        unit: m
-  - entity: number
-    name: cur_clean_area
+        unit: min
+  - entity: sensor
+    name: Current clean area
     category: diagnostic
     icon: "mdi:map-marker-distance"
     dps:
       - id: 108
-        name: cur_clean_area
+        name: sensor
         type: integer
         unit: m²
   - entity: select
-    name: water_mode
+    name: Water mode
     category: config
     icon: "mdi:water"
     dps:
       - id: 110
-        name: water_mode
+        name: option
         type: string
         mapping:
           - dps_val: 'off'
@@ -216,113 +167,132 @@ secondary_entities:
           - dps_val: strong
             value: strong
   - entity: switch
-    name: disturb_switch_1
+    name: Disturb switch
     category: config
     icon: "mdi:bell-ring"
     dps:
       - id: 113
-        name: disturb_switch_1
+        name: switch
         type: boolean
+  - entity: number
+    name: Volume
+    category: config
+    icon: "mdi:volume-high"
+    dps:
+      - id: 114
+        type: integer
+        name: value
+        range:
+          min: 0
+          max: 10
   - entity: button
-    name: material_reset_gettime
-    category: diagnostic
+    name: Get time
+    category: config
     icon: "mdi:clock-outline"
     dps:
       - id: 115
         type: string
+        name: button
         mapping:
           - dps_val: gettime
-            value: gettime
+            value: true
   - entity: button
-    name: material_reset_resetsidebrush
-    category: diagnostic
+    name: Reset side brush
+    category: config
     icon: "mdi:clock-outline"
     dps:
       - id: 115
         type: string
+        name: button
         mapping:
           - dps_val: resetsidebrush
-            value: resetsidebrush
+            value: true
   - entity: button
-    name: material_reset_resetmainbrush
-    category: diagnostic
+    name: Reset main brush
+    category: config
     icon: "mdi:clock-outline"
     dps:
       - id: 115
         type: string
+        name: button
         mapping:
           - dps_val: resetmainbrush
-            value: resetmainbrush
+            value: true
   - entity: button
-    name: material_reset_resetfilter
-    category: diagnostic
+    name: Reset filter
+    category: config
     icon: "mdi:clock-outline"
     dps:
       - id: 115
         type: string
+        name: button
         mapping:
           - dps_val: resetfilter
-            value: resetfilter
-  - entity: number
-    name: total_clean_time
+            value: true
+  - entity: sensor
+    name: Total clean time
     category: diagnostic
+    class: duration
     icon: "mdi:clock-outline"
     dps:
       - id: 116
-        name: total_clean_time
+        name: sensor
         type: integer
         unit: min
-  - entity: number
-    name: total_clean_area
+  - entity: sensor
+    name: Total clean area
     category: diagnostic
     icon: "mdi:map-marker-distance"
     dps:
       - id: 117
-        name: total_clean_area
+        name: sensor
         type: integer
         unit: m²
-  - entity: number
-    name: total_clean_count
+  - entity: sensor
+    name: Total clean count
     category: diagnostic
     icon: "mdi:counter"
     dps:
       - id: 118
-        name: total_clean_count
+        name: sensor
         type: integer
-  - entity: number
-    name: side_brush_time
+  - entity: sensor
+    name: Side brush time
     category: diagnostic
+    class: duration
     icon: "mdi:clock-outline"
     dps:
       - id: 119
-        name: side_brush_time
+        name: sensor
         type: integer
         unit: s
-  - entity: number
-    name: main_brush_time
+  - entity: sensor
+    name: Main brush time
     category: diagnostic
+    class: duration
     icon: "mdi:clock-outline"
     dps:
       - id: 120
-        name: main_brush_time
+        name: sensor
         type: integer
         unit: s
-  - entity: number
-    name: filter_time
+  - entity: sensor
+    name: Filter time
     category: diagnostic
+    class: duration
     icon: "mdi:clock-outline"
     dps:
       - id: 121
-        name: filter_time
+        name: sensor
         type: integer
         unit: s
   - entity: button
-    name: reset_map
-    category: diagnostic
+    name: Reset map
+    category: config
     icon: "mdi:map-marker-remove"
     dps:
       - id: 129
-        name: reset_map
+        name: button
         type: boolean