Browse Source

Inventor dehumidifer: Allow non-integer target humidity

Another user trying to add their dehumidifier is getting failures because the
humidity dp is actually a string not an integer.  The values "40" and "50"
were documented, so it looked like it could be treated as an integer with
step 10 and range 40 to 50, but it seems the value "CO" (constant?) is also
a possible value.

Map "CO" to 30 (out of range so it cannot be manually selected - I suspect
"CO" is automatically used when in the previously undocumented "manual" mode).

Issue #263
Jason Rumney 3 years ago
parent
commit
05f3e4dd27

+ 12 - 2
custom_components/tuya_local/devices/inventor_atmospherexl_dehumidifier.yaml

@@ -14,13 +14,21 @@ primary_entity:
           icon: "mdi:air-humidifier"
           icon: "mdi:air-humidifier"
           icon_priority: 3
           icon_priority: 3
     - id: 3
     - id: 3
-      type: integer
+      type: string
       name: humidity
       name: humidity
       range:
       range:
         min: 40
         min: 40
         max: 50
         max: 50
       mapping:
       mapping:
-        - step: 10
+        - dps_val: "CO"
+          value: 30
+          step: 10
+        - dps_val: "40"
+          value: 40
+          step: 10
+        - dps_val: "50"
+          value: 50
+          step: 10
     - id: 5
     - id: 5
       type: string
       type: string
       name: mode
       name: mode
@@ -29,6 +37,8 @@ primary_entity:
           value: Dehumidify
           value: Dehumidify
         - dps_val: night
         - dps_val: night
           value: Sleep
           value: Sleep
+        - dps_val: manual
+          value: Manual
     - id: 19
     - id: 19
       type: bitfield
       type: bitfield
       name: error_code
       name: error_code