Explorar o código

Stadlerform Eva: use relevant entity types as much as possible

- change fan from select to fan entity
- change display backlight from select to light entity with brightness
- merge auto switch into humidifier entity as mode
- remove icons that shadow the defaults
- remove extra attributes that are covered by other entities
- make binary sensor a general fault indicator, as the tank value is not actually identified.
- fix missing dps_val for fan

PR #394
Jason Rumney %!s(int64=3) %!d(string=hai) anos
pai
achega
c4bac24010

+ 27 - 67
custom_components/tuya_local/devices/stadlerform_eva_humidifier.yaml

@@ -7,11 +7,6 @@ primary_entity:
     - id: 1
       name: switch
       type: boolean
-      mapping:
-        - dps_val: false
-          icon: "mdi:air-humidifier-off"
-        - dps_val: true
-          icon: "mdi:air-humidifier"
     - id: 13
       name: humidity
       type: integer
@@ -20,40 +15,17 @@ primary_entity:
         max: 80
       mapping:
         - step: 5
-    - id: 14
-      name: current_humidity
-      type: integer
     - id: 22
       name: fault_code
       type: integer
-    - id: 23
-      name: fan_speed
-      type: integer
-      range:
-        main: 20
-        max: 100
-      mapping:
-        - step: 20
-        - scale: 0.05
-    - id: 26
-      type: boolean
-      name: warm_mode
-    - id: 29
-      type: boolean
-      name: child_lock
     - id: 102
       type: boolean
-      name: auto
-    - id: 103
-      type: string
-      name: dimmer
+      name: mode
       mapping:
-        - dps_val: "0x00"
-          value: Normal
-        - dps_val: "0x01"
-          value: Dim
-        - dps_val: "0x02"
-          value: "Off"
+        - dps_val: true
+          value: Auto
+        - dps_val: false
+          value: Continuous
 secondary_entities:
   - entity: sensor
     name: Current humidity
@@ -65,7 +37,7 @@ secondary_entities:
         unit: "%"
         class: measurement
   - entity: binary_sensor
-    name: Tank empty
+    name: Fault
     class: problem
     category: diagnostic
     dps:
@@ -75,28 +47,26 @@ secondary_entities:
         mapping:
           - dps_val: 0
             value: false
-            icon: "mdi:water"
           - value: true
-            icon: "mdi:water-alert"
-  - entity: select
-    name: Fan speed
-    icon: "mdi:fan"
-    category: config
+  - entity: fan
     dps:
+      - id: 1
+        name: switch
+        type: boolean
       - id: 23
-        name: option
-        type: integer
+        name: speed
+        type: string
         mapping:
-          - dps_val: 1
-            value: "1"
-          - dps_val: 2
-            value: "2"
-          - dps_val: 3
-            value: "3"
-          - dps_val: 4
-            value: "4"
-          - dps_val:
-            value: "5"
+          - dps_val: "1"
+            value: 20
+          - dps_val: "2"
+            value: 40
+          - dps_val: "3"
+            value: 60
+          - dps_val: "4"
+            value: 80
+          - dps_val: "5"
+            value: 100
   - entity: switch
     name: Warm mist
     icon: "mdi:fire"
@@ -117,27 +87,17 @@ secondary_entities:
             icon: "mdi:hand-back-right-off"
           - dps_val: false
             icon: "mdi:hand-back-right"
-  - entity: switch
-    name: Auto
-    class: switch
-    category: config
-    icon: "mdi:fan-auto"
-    dps:
-      - id: 102
-        name: switch
-        type: boolean
-  - entity: select
+  - entity: light
     name: Display
-    icon: "mdi:lightbulb"
     category: config
     dps:
       - id: 103
-        name: option
+        name: brightness
         type: string
         mapping:
           - dps_val: "0x00"
-            value: Normal
+            value: 100
           - dps_val: "0x01"
-            value: Dim
+            value: 50
           - dps_val: "0x02"
-            value: "Off"
+            value: 0