Kaynağa Gözat

Haoliyuan EWC02: rename and clean up

- identified original manufacturer
- rename file to follow naming convention
- use generic top level name
- adjust some entity names to follow HA convention
- convert status sensor showing only 2 states to binary sensor
- use standard timer options (expanded in next commit)

PR #3232
Jason Rumney 9 ay önce
ebeveyn
işleme
db7f01cd5f

+ 18 - 18
custom_components/tuya_local/devices/wc02_air_quality_monitor_co2.yaml → custom_components/tuya_local/devices/haoliyuan_ewc02_airquality.yaml

@@ -1,7 +1,8 @@
-name: "Air Quality Monitor (CO2) - WC02"
+name: Air quality monitor
 products:
   - id: otnwbfrffhnatwxd
-  - model: EWC02
+    model: EWC02
+    manufacturer: HaoliYuan
 entities:
   - entity: sensor
     class: temperature
@@ -52,18 +53,16 @@ entities:
             value: celsius
           - dps_val: f
             value: fahrenheit
-  - entity: sensor
-    class: enum
-    translation_key: status
+  - entity: binary_sensor
+    class: battery_charging
     dps:
       - id: 102
         type: string
         name: sensor
         mapping:
-          - dps_val: none
-            value: not-charging
           - dps_val: chraging
-            value: charging
+            value: true
+          - value: false
   - entity: switch
     name: Alarm
     category: config
@@ -72,7 +71,8 @@ entities:
         type: boolean
         name: switch
   - entity: select
-    name: Screen off Timer
+    name: Screen off delay
+    translation_key: timer
     category: config
     dps:
       - id: 106
@@ -80,28 +80,28 @@ entities:
         name: option
         mapping:
           - dps_val: Never
-            value: Always On
+            value: cancel
           - dps_val: 10minute
-            value: 10 minute
+            value: "10m"
           - dps_val: 5minute
-            value: 5 minute
+            value: "5m"
           - dps_val: 2minute
-            value: 2 minute
+            value: "2m"
           - dps_val: 1minute
-            value: 1 minute
+            value: "1m"
           - dps_val: 30s
-            value: 30 seconds
+            value: "30s"
   - entity: number
-    name: CO2 Alarm Threshold
+    name: CO2 alarm threshold
+    class: carbon_dioxide
     category: config
     dps:
       - id: 107
         type: integer
         name: value
+        unit: ppm
         range:
           min: 1000
           max: 9999
         mapping:
           - step: 100
-  # DP 108 value is boolean, at first I assumed as toggle to reinitialize CO2 sensor but after testing by changing the value there is no response.
-  # For CO2 Sensor calibration please do manually via application.