Selaa lähdekoodia

fix(hy_combo_heatpump): improve detection

Based on user experience, many of the dps can be missing in the
initial data returned by the device. Mark these as optional, and
handle the case of them missing (some like "mode" are quite fundamental
to the device working correctly, so hopefully this is only a transient
problem and their real values are returned soon after starting.

Also added product id that was previously missing.

Issue #2510
Jason Rumney 5 kuukautta sitten
vanhempi
commit
985be85c64
1 muutettua tiedostoa jossa 49 lisäystä ja 3 poistoa
  1. 49 3
      custom_components/tuya_local/devices/hy_combo_heatpump.yaml

+ 49 - 3
custom_components/tuya_local/devices/hy_combo_heatpump.yaml

@@ -1,7 +1,7 @@
 name: Multifunction heat pump
-# products:
-#   - id: UNKNOWN
-#     model: HY V1.2
+products:
+  - id: 60todr4yfe2mrcib
+    model: HY V1.2
 entities:
   - entity: climate
     dps:
@@ -30,21 +30,29 @@ entities:
               - dps_val: Hot_Cooling
                 value: cool
                 available: water_on
+              - dps_val: null
+                value: "off"
+                hidden: true
       - id: 2
         type: string
+        optional: true
         name: mode
       - id: 2
         type: string
         name: water_on
+        optional: true
         hidden: true
         mapping:
           - dps_val: Cooling
             value: false
           - dps_val: Heating
             value: false
+          - dps_val: null
+            value: false
           - value: true
       - id: 2
         type: string
+        optional: true
         name: water_off
         hidden: true
         mapping:
@@ -52,6 +60,8 @@ entities:
             value: true
           - dps_val: Heating
             value: true
+          - dps_val: null
+            value: true
           - value: false
       - id: 21
         type: integer
@@ -75,6 +85,7 @@ entities:
                   max: 25
       - id: 118
         type: integer
+        optional: true
         name: cool_temperature
         range:
           min: 7
@@ -92,6 +103,7 @@ entities:
             value: heat_pump
       - id: 119
         type: integer
+        optional: true
         name: temperature
         unit: C
         range:
@@ -108,6 +120,7 @@ entities:
     dps:
       - id: 2
         type: string
+        optional: true
         name: option
         mapping:
           - dps_val: Hot
@@ -127,23 +140,33 @@ entities:
     dps:
       - id: 3
         type: boolean
+        optional: true
         name: switch
+        mapping:
+          - dps_val: null
+            value: false
+            hidden: true
   - entity: binary_sensor
     class: problem
     category: diagnostic
     dps:
       - id: 15
         type: bitfield
+        optional: true
         name: sensor
         mapping:
           - dps_val: 0
             value_redirect: fault_2
+          - dps_val: null
+            value_redirect: fault_2
           - value: true
       - id: 15
         type: bitfield
+        optional: true
         name: fault_code
       - id: 35
         type: integer
+        optional: true
         name: fault_7
         hidden: true
         mapping:
@@ -152,61 +175,82 @@ entities:
           - value: true
       - id: 35
         type: integer
+        optional: true
         name: fault_code_7
       - id: 109
         type: bitfield
+        optional: true
         name: fault_2
         hidden: true
         mapping:
           - dps_val: 0
             value_redirect: fault_3
+          - dps_val: null
+            value_redirect: fault_3
           - value: true
       - id: 109
         type: bitfield
+        optional: true
         name: fault_code_2
       - id: 120
         type: bitfield
+        optional: true
         name: fault_3
         hidden: true
         mapping:
           - dps_val: 0
             value_redirect: fault_4
+          - dps_val: null
+            value_redirect: fault_4
           - value: true
       - id: 120
         type: bitfield
+        optional: true
         name: fault_code_3
       - id: 121
         type: bitfield
+        optional: true
         name: fault_4
         hidden: true
         mapping:
           - dps_val: 0
             value_redirect: fault_5
+          - dps_val: null
+            value_redirect: fault_5
           - value: true
       - id: 121
         type: bitfield
+        optional: true
         name: fault_code_4
       - id: 122
         type: bitfield
+        optional: true
         name: fault_5
         hidden: true
         mapping:
           - dps_val: 0
             value_redirect: fault_6
+          - dps_val: null
+            value_redirect: fault_6
           - value: true
       - id: 122
         type: bitfield
+        optional: true
         name: fault_code_5
       - id: 123
         type: bitfield
+        optional: true
         name: fault_6
         hidden: true
         mapping:
           - dps_val: 0
             value_redirect: fault_7
+          - dps_val: null
+            value_redirect: fault_7
           - value: true
       - id: 123
         type: bitfield
+        optional: true
         name: fault_code_6
   - entity: number
     name: Night start
@@ -215,6 +259,7 @@ entities:
     dps:
       - id: 4
         type: integer
+        optional: true
         name: value
         unit: h
         range:
@@ -227,6 +272,7 @@ entities:
     dps:
       - id: 10
         type: integer
+        optional: true
         name: value
         unit: h
         range: