Преглед изворни кода

feat(mustool_mt15mt29_airbox): add product id for MT13

- hide entities that are not available on MT13 when the device does not provide them.

PR #5560 by @LinusIta
Jason Rumney пре 3 дана
родитељ
комит
0dd7b1b648
1 измењених фајлова са 63 додато и 0 уклоњено
  1. 63 0
      custom_components/tuya_local/devices/mustool_mt15mt29_airbox.yaml

+ 63 - 0
custom_components/tuya_local/devices/mustool_mt15mt29_airbox.yaml

@@ -3,6 +3,9 @@ products:
   - id: owmkja70doamcxkh
   - id: owmkja70doamcxkh
     manufacturer: Mustool
     manufacturer: Mustool
     model: MT15/MT29
     model: MT15/MT29
+  - id: tf5vafuyq3hiibs4
+    manufacturer: Mustool
+    model: MT13W
 entities:
 entities:
   - entity: sensor
   - entity: sensor
     translation_key: air_quality
     translation_key: air_quality
@@ -102,6 +105,7 @@ entities:
     name: Alarm volume
     name: Alarm volume
     icon: "mdi:alarm-multiple"
     icon: "mdi:alarm-multiple"
     category: config
     category: config
+    hidden: unavailable
     dps:
     dps:
       - id: 28
       - id: 28
         type: string
         type: string
@@ -116,6 +120,14 @@ entities:
             value: high
             value: high
           - dps_val: mute
           - dps_val: mute
             value: mute
             value: mute
+      - id: 28
+        type: string
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
   - entity: sensor
   - entity: sensor
     class: volatile_organic_compounds
     class: volatile_organic_compounds
     dps:
     dps:
@@ -137,6 +149,7 @@ entities:
   - entity: light
   - entity: light
     translation_key: backlight
     translation_key: backlight
     category: config
     category: config
+    hidden: unavailable
     dps:
     dps:
       - id: 103
       - id: 103
         type: string
         type: string
@@ -151,6 +164,14 @@ entities:
             value: 192
             value: 192
           - dps_val: level_4
           - dps_val: level_4
             value: 255
             value: 255
+      - id: 103
+        type: string
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
   - entity: number
   - entity: number
     name: CO2 alarm threshold
     name: CO2 alarm threshold
     category: config
     category: config
@@ -217,6 +238,7 @@ entities:
   - entity: time
   - entity: time
     name: Alarm 1
     name: Alarm 1
     category: config
     category: config
+    hidden: unavailable
     dps:
     dps:
       - id: 109
       - id: 109
         type: integer
         type: integer
@@ -229,9 +251,14 @@ entities:
         type: boolean
         type: boolean
         optional: true
         optional: true
         name: available
         name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
   - entity: time
   - entity: time
     name: Alarm 2
     name: Alarm 2
     category: config
     category: config
+    hidden: unavailable
     dps:
     dps:
       - id: 110
       - id: 110
         type: integer
         type: integer
@@ -244,9 +271,14 @@ entities:
         type: boolean
         type: boolean
         optional: true
         optional: true
         name: available
         name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
   - entity: time
   - entity: time
     name: Alarm 3
     name: Alarm 3
     category: config
     category: config
+    hidden: unavailable
     dps:
     dps:
       - id: 111
       - id: 111
         type: integer
         type: integer
@@ -259,6 +291,10 @@ entities:
         type: boolean
         type: boolean
         optional: true
         optional: true
         name: available
         name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
   - entity: select
   - entity: select
     translation_key: temperature_unit
     translation_key: temperature_unit
     category: config
     category: config
@@ -333,26 +369,53 @@ entities:
     name: Alarm 1
     name: Alarm 1
     icon: "mdi:alarm"
     icon: "mdi:alarm"
     category: config
     category: config
+    hidden: unavailable
     dps:
     dps:
       - id: 116
       - id: 116
         type: boolean
         type: boolean
         optional: true
         optional: true
         name: switch
         name: switch
+      - id: 116
+        type: boolean
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
   - entity: switch
   - entity: switch
     name: Alarm 2
     name: Alarm 2
     icon: "mdi:alarm"
     icon: "mdi:alarm"
     category: config
     category: config
+    hidden: unavailable
     dps:
     dps:
       - id: 117
       - id: 117
         type: boolean
         type: boolean
         optional: true
         optional: true
         name: switch
         name: switch
+      - id: 117
+        type: boolean
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true
   - entity: switch
   - entity: switch
     name: Alarm 3
     name: Alarm 3
     icon: "mdi:alarm"
     icon: "mdi:alarm"
     category: config
     category: config
+    hidden: unavailable
     dps:
     dps:
       - id: 118
       - id: 118
         type: boolean
         type: boolean
         optional: true
         optional: true
         name: switch
         name: switch
+      - id: 118
+        type: boolean
+        optional: true
+        name: available
+        mapping:
+          - dps_val: null
+            value: false
+          - value: true