Prechádzať zdrojové kódy

fix(hiniso_dehumidifier): make uv, ionizer, child lock optional

It seems these functions are not supported on all models, and missing from log
when unavailable (but still documented in Tuya dps info).

Make the entities hidden if unavailable to avoid confusion.

Issue #5362
Jason Rumney 4 dní pred
rodič
commit
416148da85

+ 30 - 0
custom_components/tuya_local/devices/hiniso_dehumidifier.yaml

@@ -81,28 +81,58 @@ entities:
   - entity: switch
     translation_key: ionizer
     category: config
+    hidden: unavailable
     dps:
       - id: 10
         type: boolean
+        optional: true
         name: switch
+      - id: 10
+        type: boolean
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
 
   # UV
   - entity: switch
     translation_key: uv_sterilization
     category: config
+    hidden: unavailable
     dps:
       - id: 13
         type: boolean
+        optional: true
         name: switch
+      - id: 13
+        type: boolean
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
 
   # CHILD LOCK
   - entity: lock
     translation_key: child_lock
     category: config
+    hidden: unavailable
     dps:
       - id: 16
         type: boolean
+        optional: true
         name: lock
+      - id: 16
+        type: boolean
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
 
   # FAN SPEED
   - entity: fan