浏览代码

feat(daizuki_heatpump): handle C version.

Based on data available, bit 21 of flags (dp 110) tells the device's native temperature unit.
The F version that this was previously for always reports C for current temperature, but
uses F for temperature. According to PR #5521, an EU version of Nordis Orion EVO (same
product id as TCL AirMax) exists with the only difference being the use of C for temperature.

Use the temperature unit flag to handle this difference so that the product id match
does not mislead users into loading the wrong config (other configs exist with basically
the same dps layout, some with the same presets and temperature range, but choosing the
right one is difficult without the automatic product id matching telling you which is the
correct on).

PR #5521 by @virtualas10
Jason Rumney 1 天之前
父节点
当前提交
85493d1b71
共有 1 个文件被更改,包括 23 次插入7 次删除
  1. 23 7
      custom_components/tuya_local/devices/daizuki_heatpump.yaml

+ 23 - 7
custom_components/tuya_local/devices/daizuki_heatpump.yaml

@@ -30,13 +30,19 @@ entities:
       - id: 2
         type: integer
         name: temperature
-        unit: F
         range:
-          min: 610
-          max: 880
+          min: 160
+          max: 310
         mapping:
           - scale: 10
-            step: 10
+            step: 5
+            constraint: temperature_unit
+            conditions:
+              - dps_val: 2097152
+                step: 10
+                range:
+                  min: 610
+                  max: 880
       - id: 3
         type: integer
         name: current_temperature
@@ -45,9 +51,12 @@ entities:
           min: -20
           max: 100
         mapping:
-          - target_range:
-              min: -4
-              max: 212
+          - constraint: temperature_unit
+            conditions:
+              - dps_val: 2097152
+                target_range:
+                  min: -4
+                  max: 212
       - id: 4
         type: string
         name: mode
@@ -84,6 +93,13 @@ entities:
       - id: 110
         type: bitfield
         name: flags
+      - id: 110
+        type: bitfield
+        name: temperature_unit
+        mapping:
+          - dps_val: 2097152
+            value: F
+          - value: C
       - id: 113
         type: string
         name: swing_mode