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

Aleco D12 Home: fix remaining issues in config

- swap dps_val and value in mappings where they are obviously incorrect.
- based on #328, include D16 Home as it is an identical device, add
  missing swing and anion dps.
- fix fan mappings and remove the duplicate select entity.
- be more conservative about overriding icons, per modern HA guidelines

PR #386
Issue #328
Jason Rumney 3 лет назад
Родитель
Сommit
b9a885cccf

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -176,3 +176,4 @@ Further device support has been made with the assistance of users.  Please consi
 - [Celezak](https://github.com/Celezak) for assistance supporting Qnect 3 outlet + USB powerstrips.
 - [ShayGus](https://github.com/ShayGus) for contributing support for Avatto curtain and light switch.
 - [garry0garry](https://github.com/garry0garry) for assistance supporting TOMPD circuit breakers.
+- [romicaiarca](https://github.com/romicaiarca) for contributing Aleco D12 Home dehumidifier support.

+ 1 - 1
DEVICES.md

@@ -118,7 +118,7 @@
 ### Dehumidifiers
 
 - AlecoAir D12 ECO dehumidifier
-- AlecoAir D12 Home dehumidifier
+- AlecoAir D12/D16 Home dehumidifier
 - AlecoAir D14 purifying dehumidifier
 - AlecoAir D16 purifying dehumidifier
 - ElectriQ CD12PRO-LE dehumidifier

+ 2 - 2
custom_components/tuya_local/devices/alecoair_d12_dehumidifier.yaml

@@ -1,7 +1,7 @@
-name: AlecoAir D12 dehumidifier
+name: AlecoAir D12 ECO dehumidifier
 products:
   - id: gcthce4ejb8nzgow
-#    name: D12 ECO 2.0
+    name: D12 ECO 2.0
 primary_entity:
   entity: humidifier
   class: dehumidifier

+ 96 - 104
custom_components/tuya_local/devices/alecoair_d12_home_dehumidifier.yaml

@@ -1,7 +1,7 @@
-name: AlecoAir D12 Home dehumidifier
+name: AlecoAir Home dehumidifier
 products:
   - id: hp1sjssyokokbrsg
-    name: AlecoAir D12 Home
+    name: AlecoAir D12/D16 Home    
 primary_entity:
   entity: humidifier
   class: dehumidifier
@@ -9,25 +9,14 @@ primary_entity:
     - id: 1
       name: switch
       type: boolean
-      mapping:
-        - dps_val: false
-          icon: "mdi:air-humidifier-off"
-          icon_priority: 1
-        - dps_val: true
-          icon: "mdi:air-humidifier"
-          icon_priority: 4
     - id: 2
       name: mode
       type: string
       mapping:
-        - dps_val: Continuous
-          value: "1"
-          icon: mdi:fan
-          icon_priority: 3
-        - dps_val: Auto
-          value: "0"
-          icon: "mdi:fan-auto"
-          icon_priority: 3
+        - dps_val: "1"
+          value: Continuous
+        - dps_val: "0"
+          value: Auto
     - id: 4
       name: humidity
       type: integer
@@ -43,13 +32,7 @@ primary_entity:
         - dps_val: 0
           value: OK
         - dps_val: 8
-          value: E1
-          icon: "mdi:cup-water"
-          icon_priority: 2
-        - dps_val: 2
-          value: E2
-          icon: "mdi:cup-water"
-          icon_priority: 2
+          value: tank
 secondary_entities:
   - entity: sensor
     name: Current humidity
@@ -60,36 +43,35 @@ secondary_entities:
         name: sensor
         unit: "%"
         class: measurement
-  - entity: select
-    name: Wind speed
-    icon: "mdi:fan"
+  - entity: switch
+    name: Ionizer
     category: config
+    icon: "mdi:creation"
     dps:
-      - id: 6
-        name: option
-        type: string
-        mapping:
-          - dps_val: "0"
-            icon: "mdi:fan-speed-2"
-            icon_priority: 1
-          - dps_val: "1"
-            icon: "mdi:fan-speed-1"
-            icon_priority: 4
+      - id: 5
+        type: boolean
+        name: switch
+        optional: true
   - entity: fan
     dps:
-      - id: 6
+      - id: 1
         type: boolean
         name: switch
-      - id: 5
-        type: string
+      - id: 6
         name: speed
+        type: string
         mapping:
           - dps_val: "0"
-            icon: "mdi:fan-speed-2"
-            icon_priority: 1
+            value: 100
           - dps_val: "1"
-            icon: "mdi:fan-speed-1"
-            icon_priority: 4
+            value: 50
+      - id: 8
+        name: oscillate
+        type: boolean
+        optional: true
+        mapping:
+          - dps_val: null
+            invalid: true
   - entity: lock
     name: Child lock
     category: config
@@ -111,56 +93,56 @@ secondary_entities:
         name: option
         type: string
         mapping:
-          - dps_val: Cancel
-            value: "0"
-          - dps_val: 1 hour
-            value: "1"
-          - dps_val: 2 hours
-            value: "2"
-          - dps_val: 3 hours
-            value: "3"
-          - dps_val: 4 hours
-            value: "4"
-          - dps_val: 5 hours
-            value: "5"
-          - dps_val: 6 hours
-            value: "6"
-          - dps_val: 7 hours
-            value: "7"
-          - dps_val: 8 hours
-            value: "8"
-          - dps_val: 9 hours
-            value: "9"
-          - dps_val: 10 hours
-            value: "10"
-          - dps_val: 11 hours
-            value: "11"
-          - dps_val: 12 hours
-            value: "12"
-          - dps_val: 13 hours
-            value: "13"
-          - dps_val: 14 hours
-            value: "14"
-          - dps_val: 15 hours
-            value: "15"
-          - dps_val: 16 hours
-            value: "16"
-          - dps_val: 17 hours
-            value: "17"
-          - dps_val: 18 hours
-            value: "18"
-          - dps_val: 19 hours
-            value: "19"
-          - dps_val: 20 hours
-            value: "20"
-          - dps_val: 21 hours
-            value: "21"
-          - dps_val: 22 hours
-            value: "22"
-          - dps_val: 23 hours
-            value: "23"
-          - dps_val: 24 hours
-            value: "24"
+          - dps_val: "0"
+            value: Cancel
+          - dps_val: "1"
+            value: "1 hour"
+          - dps_val: "2"
+            value: "2 hours"
+          - dps_val: "3"
+            value: "3 hours"
+          - dps_val: "4"
+            value: "4 hours"
+          - dps_val: "5"
+            value: "5 hours"
+          - dps_val: "6"
+            value: "6 hours"
+          - dps_val: "7"
+            value: "7 hours"
+          - dps_val: "8"
+            value: "8 hours"
+          - dps_val: "9"
+            value: "9 hours"
+          - dps_val: "10"
+            value: "10 hours"
+          - dps_val: "11"
+            value: "11 hours"
+          - dps_val: "12"
+            value: "12 hours"
+          - dps_val: "13"
+            value: "13 hours"
+          - dps_val: "14"
+            value: "14 hours"
+          - dps_val: "15"
+            value: "15 hours"
+          - dps_val: "16"
+            value: "16 hours"
+          - dps_val: "17"
+            value: "17 hours"
+          - dps_val: "18"
+            value: "18 hours"
+          - dps_val: "19"
+            value: "19 hours"
+          - dps_val: "20"
+            value: "20 hours"
+          - dps_val: "21"
+            value: "21 hours"
+          - dps_val: "22"
+            value: "22 hours"
+          - dps_val: "23"
+            value: "23 hours"
+          - dps_val: "24"
+            value: "24 hours"
   - entity: sensor
     name: Remaining Time
     class: duration
@@ -168,11 +150,26 @@ secondary_entities:
       - id: 13
         type: integer
         name: sensor
-        unit: "minutes"
-        class: measurement
+        unit: min
   - entity: binary_sensor
     name: Tank
     class: problem
+    icon: "mdi:cup-outline"
+    icon-priority: 2
+    category: diagnostic
+    dps:
+      - id: 11
+        type: bitfield
+        name: sensor
+        mapping:
+          - dps_val: 8
+            value: true
+            icon: "mdi:cup-water"
+            icon-priority: 1
+          - value: false
+  - entity: binary_sensor
+    name: Fault
+    class: problem
     category: diagnostic
     dps:
       - id: 11
@@ -181,18 +178,13 @@ secondary_entities:
         mapping:
           - dps_val: 0
             value: false
+          - dps_val: 8
+            value: false
           - value: true
   - entity: switch
     name: Inside Drying
-    icon: "mdi:air-humidifier"
+    icon: "mdi:tshirt-crew"
     dps:
       - id: 101
         name: switch
         type: boolean
-        mapping:
-          - dps_val: false
-            icon: "mdi:air-humidifier-off"
-            icon_priority: 1
-          - dps_val: true
-            icon: "mdi:air-humidifier"
-            icon_priority: 4