Browse Source

fix(fisher_summer_air_conditioner): fixes to switches and feature flags

DP 123 had some misunderstandings and missing gaps, DP 110 had some incorrect
masks and missing opportunities for marking features unavailable.

Issue #5845
Jason Rumney 1 day ago
parent
commit
316ad2115e

+ 51 - 8
custom_components/tuya_local/devices/fisher_summer_air_conditioner.yaml

@@ -116,12 +116,30 @@ entities:
         #   ??? - 19 is missing in Tuya json
         #   ??? - 19 is missing in Tuya json
         #   20. presence or absence of PM2.5 (implemented on PM25)
         #   20. presence or absence of PM2.5 (implemented on PM25)
         #   21. temperature scale switching, 1 is Fahrenheit, 0 is Celsius
         #   21. temperature scale switching, 1 is Fahrenheit, 0 is Celsius
-        #   22. soft wind (implemented on Sleep)
+        #   22. soft wind (implemented on Soft wind)
         #   23. left and right wide-angle air supply (implemented on Set
         #   23. left and right wide-angle air supply (implemented on Set
         #       horizontal direction to filter "wide" options)
         #       horizontal direction to filter "wide" options)
+        #   24. fresh air function
       - id: 123
       - id: 123
         name: options
         name: options
         type: string
         type: string
+        # bit field for togling advanced options
+        #  0. Eco
+        #  1. Intelligent dehumidification / anti-mildew
+        #  2. Evaporator cleaning
+        #  3. light
+        #  4. beep
+        #  5. health
+        #  6. ---
+        #  7. photosensitive
+        #  8. dry
+        #  9. ---
+        # 10. ---
+        # 11. ---
+        # 12. 8 degree heating
+        # 13. filter detection
+        # 14. Fahrenheit +1 flag
+        # 15. Soft wind
       - id: 128
       - id: 128
         name: style
         name: style
         type: string
         type: string
@@ -176,16 +194,41 @@ entities:
   - entity: switch
   - entity: switch
     name: Soft wind
     name: Soft wind
     category: config
     category: config
+    hidden: unavailable
     icon: "mdi:weather-windy"
     icon: "mdi:weather-windy"
     dps:
     dps:
       - id: 123
       - id: 123
         type: hex
         type: hex
         name: switch
         name: switch
         mask: "8000"
         mask: "8000"
+      - id: 110
+        type: bitfield
+        name: available
+        mapping:
+          - dps_val: 4194304
+            value: true
+          - value: false
   - entity: switch
   - entity: switch
     name: Anti-mildew
     name: Anti-mildew
     category: config
     category: config
+    hidden: unavailable
     icon: "mdi:water-off-outline"
     icon: "mdi:water-off-outline"
+    dps:
+      - id: 123
+        type: hex
+        name: switch
+        mask: "0002"
+      - id: 110
+        type: bitfield
+        name: available
+        mapping:
+          - dps_val: 128
+            value: true
+          - value: false
+  - entity: switch
+    name: Evaporator drying
+    icon: "mdi:water-off-outline"
+    category: config
     dps:
     dps:
       - id: 123
       - id: 123
         type: hex
         type: hex
@@ -277,29 +320,28 @@ entities:
     name: Sleep
     name: Sleep
     category: config
     category: config
     icon: "mdi:weather-night"
     icon: "mdi:weather-night"
-    hidden: unavailable
     dps:
     dps:
       - id: 105
       - id: 105
         name: option
         name: option
         type: string
         type: string
+        optional: true
         mapping:
         mapping:
           - dps_val: "off"
           - dps_val: "off"
             value: "Off"
             value: "Off"
-            default: true
           - dps_val: normal
           - dps_val: normal
             value: Normal
             value: Normal
           - dps_val: old
           - dps_val: old
             value: Elderly
             value: Elderly
           - dps_val: child
           - dps_val: child
             value: Child
             value: Child
+      - id: 105
+        type: string
         optional: true
         optional: true
-      - id: 110
-        type: bitfield
         name: available
         name: available
         mapping:
         mapping:
-          - dps_val: 4194394
-            value: true
-          - value: false
+          - dps_val: null
+            value: false
+          - value: true
   - entity: select
   - entity: select
     name: Vertical sweep
     name: Vertical sweep
     category: config
     category: config
@@ -578,6 +620,7 @@ entities:
   - entity: select
   - entity: select
     name: Hot cold wind
     name: Hot cold wind
     category: config
     category: config
+    hidden: unavailable
     icon: "mdi:sun-snowflake"
     icon: "mdi:sun-snowflake"
     dps:
     dps:
       - id: 132
       - id: 132