瀏覽代碼

feat(windcalm_fan): hide sound switch when unavailable

This was already optional, allowing devices without it to match, but the
entity was always there. Disable it when unavailable so the user doesn't
have to.

PR #5470
Jason Rumney 1 天之前
父節點
當前提交
d36163dc14
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      custom_components/tuya_local/devices/windcalm_fan.yaml

+ 9 - 0
custom_components/tuya_local/devices/windcalm_fan.yaml

@@ -29,8 +29,17 @@ entities:
   - entity: switch
   - entity: switch
     translation_key: sound
     translation_key: sound
     category: config
     category: config
+    hidden: unavailable
     dps:
     dps:
       - id: 66
       - id: 66
         type: boolean
         type: boolean
         name: switch
         name: switch
         optional: true
         optional: true
+      - id: 66
+        type: boolean
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true