Explorar o código

Klarstein dehumidifier: use fan entity rather than selects

Simplify config by removing some icons that just mimick the default (looks
copy and paste from another dehumidifier that had some more complex icon logic
based on the icon_priority assigned).
Jason Rumney %!s(int64=3) %!d(string=hai) anos
pai
achega
4fb82d4616

+ 20 - 16
custom_components/tuya_local/devices/klarstein_dryfy_pro_connect_dehumidifier.yaml

@@ -9,13 +9,6 @@ primary_entity:
     - id: 1
     - id: 1
       name: switch
       name: switch
       type: boolean
       type: boolean
-      mapping:
-        - dps_val: false
-          icon: "mdi:air-humidifier-off"
-          icon_priority: 3
-        - dps_val: true
-          icon: "mdi:air-humidifier"
-          icon_priority: 5        
     - id: 4
     - id: 4
       type: integer
       type: integer
       name: humidity
       name: humidity
@@ -25,12 +18,13 @@ primary_entity:
       mapping:
       mapping:
         - step: 5          
         - step: 5          
 secondary_entities:
 secondary_entities:
-  - entity: select
-    name: "Mode"
-    icon: "mdi:fan"
+  - entity: fan
     dps:
     dps:
+      - id: 1
+        name: switch
+        type: boolean
       - id: 2
       - id: 2
-        name: option
+        name: preset_mode
         type: string
         type: string
         optional: true
         optional: true
         mapping:
         mapping:
@@ -43,9 +37,19 @@ secondary_entities:
             value: "Low"
             value: "Low"
           - dps_val: "fan"
           - dps_val: "fan"
             value: "Fan"
             value: "Fan"
-
+      - id: 102
+        name: oscillate
+        type: string
+        optional: true
+        mapping:
+          - dps_val: "0_90"
+            value: true
+          - dps_val: "45"
+            value: false
+          - dps_val: "90"
+            value: false
   - entity: select
   - entity: select
-    name: "OSC"
+    name: Direction
     category: config
     category: config
     icon: "mdi:sprinkler-variant"
     icon: "mdi:sprinkler-variant"
     dps:
     dps:
@@ -79,7 +83,7 @@ secondary_entities:
         unit: C
         unit: C
         class: measurement
         class: measurement
   - entity: switch
   - entity: switch
-    name: "UV sterilization"
+    name: UV sterilization
     icon: "mdi:shield-half-full"
     icon: "mdi:shield-half-full"
     dps:
     dps:
       - id: 10
       - id: 10
@@ -95,9 +99,9 @@ secondary_entities:
         optional: true
         optional: true
         mapping:
         mapping:
           - dps_val: false
           - dps_val: false
-            value: ON
+            value: true
           - dps_val: true
           - dps_val: true
-            value: OFF        
+            value: false  
   - entity: switch
   - entity: switch
     name: "Humidity indicator"
     name: "Humidity indicator"
     category: config
     category: config