Explorar o código

Clofte Duo 400 humidifier: changes from review

- naming case
- sleep switch: don't override translations for name
- pm 2.5 sensor: use standard class
- water level sensor: use translations
Jason Rumney hai 1 ano
pai
achega
1b7dd4ef9d

+ 13 - 8
custom_components/tuya_local/devices/clofte_duo_400_humidifier.yaml

@@ -1,8 +1,8 @@
 name: Humidifier
 name: Humidifier
 products:
 products:
   - id: aa8iuikeenvbsznx
   - id: aa8iuikeenvbsznx
-    manufacturer: CLOFTE
-    model: DUO 400
+    manufacturer: Clofte
+    model: Duo 400
     model_id: T3-CLOFTE
     model_id: T3-CLOFTE
 entities:
 entities:
   - entity: fan
   - entity: fan
@@ -18,15 +18,14 @@ entities:
           min: 0
           min: 0
           max: 4
           max: 4
   - entity: switch
   - entity: switch
-    name: Sleep
     translation_key: sleep
     translation_key: sleep
     dps:
     dps:
       - id: 101
       - id: 101
         name: switch
         name: switch
         type: boolean
         type: boolean
   - entity: switch
   - entity: switch
-    name: Quiet
-    icon: mdi:volume-high
+    name: Mute
+    icon: mdi:volume-mute
     dps:
     dps:
       - id: 116
       - id: 116
         name: switch
         name: switch
@@ -38,19 +37,25 @@ entities:
         name: switch
         name: switch
         type: boolean
         type: boolean
   - entity: sensor
   - entity: sensor
-    name: PM2.5
+    class: pm25
     dps:
     dps:
       - id: 2
       - id: 2
         type: integer
         type: integer
         name: sensor
         name: sensor
         unit: µg/m³
         unit: µg/m³
   - entity: sensor
   - entity: sensor
-    name: Water level
+    translation_key: water_level
+    class: enum
     category: diagnostic
     category: diagnostic
     dps:
     dps:
       - id: 108
       - id: 108
         type: string
         type: string
         name: sensor
         name: sensor
+        mapping:
+          - dps_val: low
+            value: low
+          - dps_val: high
+            value: high
   - entity: button
   - entity: button
     translation_key: filter_reset
     translation_key: filter_reset
     category: config
     category: config
@@ -59,7 +64,7 @@ entities:
         type: boolean
         type: boolean
         name: button
         name: button
   - entity: sensor
   - entity: sensor
-    name: Filter left
+    name: Filter life
     icon: mdi:air-filter
     icon: mdi:air-filter
     category: diagnostic
     category: diagnostic
     dps:
     dps: