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

Klarta Stor 2: Changes from review

PR #1365
Jason Rumney 2 лет назад
Родитель
Сommit
dff76df26e
1 измененных файлов с 41 добавлено и 50 удалено
  1. 41 50
      custom_components/tuya_local/devices/klarta_stor2_purifier.yaml

+ 41 - 50
custom_components/tuya_local/devices/klarta_stor2_purifier.yaml

@@ -1,14 +1,43 @@
-name: Klarta Stor 2 air purifier
+name: Air purifier
 products:
   - id: ku6ae3y8ad6tbx3b
-    name: "KLARTA STOR 2 "
+    name: "Klarta Stor 2 "
 primary_entity:
-  entity: switch
+  entity: fan
+  translation_key: fan_with_presets
   icon: "mdi:air-purifier"
   dps:
     - id: 1
       type: boolean
       name: switch
+    - id: 3
+      type: string
+      name: preeset_mode
+      mapping:
+        - dps_val: auto
+          value: smart
+        - dps_val: manual
+          value: normal
+        - dps_val: sleep
+          value: sleep
+        - dps_val: screenoff
+          value: displayoff
+    - id: 4
+      type: string
+      name: speed
+      mapping:
+        - dps_val: speedmode1
+          value: 17
+        - dps_val: speedmode1
+          value: 33
+        - dps_val: speedmode1
+          value: 50
+        - dps_val: speedmode1
+          value: 67
+        - dps_val: speedmode1
+          value: 83
+        - dps_val: speedmode1
+          value: 100
 secondary_entities:
   - entity: sensor
     class: pm25
@@ -18,41 +47,6 @@ secondary_entities:
         name: sensor
         class: measurement
         unit: ugm3
-  - entity: select
-    name: Mode
-    dps:
-      - id: 3
-        name: option
-        type: string
-        mapping:
-          - dps_val: auto
-            value: "Auto"
-          - dps_val: "manual"
-            value: "Manual"
-          - dps_val: "sleep"
-            value: "Sleep"
-          - dps_val: "screenoff"
-            value: "Turn off LEDs"
-  - entity: select
-    name: Speed
-    dps:
-      - id: 4
-        name: option
-        type: string
-        icon: "mdi:fan"
-        mapping:
-          - dps_val: speedmode1
-            value: "Silent"
-          - dps_val: speedmode2
-            value: "Silent+"
-          - dps_val: speedmode3
-            value: "Slow"
-          - dps_val: speedmode4
-            value: "Slow+"
-          - dps_val: speedmode5
-            value: "Fast"
-          - dps_val: speedmode6
-            value: "Turbo"
   - entity: sensor
     name: Active filter life
     icon: "mdi:air-filter"
@@ -63,20 +57,22 @@ secondary_entities:
         name: sensor
         unit: "%"
   - entity: select
-    name: AutoMode
+    name: Auto mode
+    icon: "mdi:auto-mode"
     dps:
       - id: 101
         name: option
         type: string
         mapping:
           - dps_val: AutoSleep
-            value: "AutoSleep"
+            value: Sleep
           - dps_val: AutoNormal
-            value: "AutoNormal"
+            value: Normal
           - dps_val: AutoTurbo
-            value: "AutoTurbo"
+            value: Turbo
   - entity: switch
-    name: Ionization
+    name: Ionizer
+    icon: "mdi:atom-variant"
     category: config
     dps:
       - id: 6
@@ -88,15 +84,11 @@ secondary_entities:
   - entity: lock
     name: Child lock
     category: config
+    icon: "mdi:hand-back-right-off"
     dps:
       - id: 7
         type: boolean
         name: lock
-        mapping:
-          - dps_val: true
-            icon: "mdi:hand-back-right-off"
-          - dps_val: false
-            icon: "mdi:hand-back-right"
   - entity: button
     name: Filter reset
     class: restart
@@ -106,7 +98,7 @@ secondary_entities:
         type: boolean
         name: button
   - entity: select
-    name: Countdown
+    name: Timer
     icon: "mdi:timer"
     category: config
     dps:
@@ -134,7 +126,6 @@ secondary_entities:
         class: measurement
   - entity: sensor
     class: humidity
-    icon: "mdi:water-percent"
     dps:
       - id: 13
         type: integer