瀏覽代碼

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 月之前
父節點
當前提交
416148da85
共有 1 個文件被更改,包括 30 次插入 和 0 次删除
  1. 30 0
      custom_components/tuya_local/devices/hiniso_dehumidifier.yaml

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

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