Prechádzať zdrojové kódy

fix (breville_airrounderplus_heater): improve fan/heat logic

Previous logic worked for reflecting the state of the fan and heat modes,
but it was not really working for setting heat modes from HA.

This changes from using a value_redirect, to using conditions, which has
the side effect of setting both dps at once, but this device seems to
handle this, as it is already used in the hvac_mode.

Issue #3582
Jason Rumney 6 mesiacov pred
rodič
commit
6a4da84f30

+ 31 - 11
custom_components/tuya_local/devices/breville_airrounderplus_heater.yaml

@@ -36,28 +36,48 @@ entities:
         type: string
         type: string
         name: heat_mode
         name: heat_mode
         hidden: true
         hidden: true
-        mapping:
-          - dps_val: heat_mid
-            value: low
-          - dps_val: heat_high
-            value: medium
-          - dps_val: heat_0
-            value: high
-          - dps_val: heat_low
-            value: "off"
-            hidden: true
       - id: 5
       - id: 5
         type: string
         type: string
         name: fan_mode
         name: fan_mode
         mapping:
         mapping:
           - dps_val: SleepWind
           - dps_val: SleepWind
-            value_redirect: heat_mode
+            constraint: heat_mode
+            conditions:
+              - dps_val: heat_mid
+                value: low
+                available: in_heat_mode
+              - dps_val: heat_high
+                value: medium
+                available: in_heat_mode
+              - dps_val: heat_0
+                value: high
+                available: in_heat_mode
+              - dps_val: heat_low
+                value: "off"
+                hidden: true
           - dps_val: NatureWind_Low
           - dps_val: NatureWind_Low
             value: low
             value: low
+            available: in_fan_mode
           - dps_val: NatureWind_High
           - dps_val: NatureWind_High
             value: medium
             value: medium
+            available: in_fan_mode
           - dps_val: CoolWind_0
           - dps_val: CoolWind_0
             value: high
             value: high
+            available: in_fan_mode
+      - id: 5
+        type: string
+        name: in_fan_mode
+        mapping:
+          - dps_val: SleepWind
+            value: false
+          - value: true
+      - id: 4
+        type: string
+        name: in_heat_mode
+        mapping:
+          - dps_val: heat_low
+            value: false
+          - value: true
       - id: 101
       - id: 101
         type: string
         type: string
         name: swing_mode
         name: swing_mode