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

feat (zx_gs21_gasmonitor): add binary_sensor for gas alarm

- split gas alarm from attribute to binary_sensor
- remove diagnostic category on several sensors
Jason Rumney пре 5 дана
родитељ
комит
afcce51d35
1 измењених фајлова са 8 додато и 4 уклоњено
  1. 8 4
      custom_components/tuya_local/devices/zx_gs21_gasmonitor.yaml

+ 8 - 4
custom_components/tuya_local/devices/zx_gs21_gasmonitor.yaml

@@ -5,16 +5,22 @@ products:
 entities:
   - entity: sensor
     name: Gas leak
-    category: diagnostic
     dps:
       - id: 2
         type: integer
         name: sensor
         unit: "% LEL"
         class: measurement
+  - entity: binary_sensor
+    class: gas
+    dps:
       - id: 1
         type: string
-        name: gas_state
+        name: sensor
+        mapping:
+          - dps_val: alarm
+            value: true
+          - value: false
   - entity: number
     name: Alarm duration
     category: config
@@ -63,7 +69,6 @@ entities:
   - entity: binary_sensor
     name: Carbon monoxide alarm
     class: gas
-    category: diagnostic
     dps:
       - id: 18
         type: string
@@ -74,7 +79,6 @@ entities:
           - value: false
   - entity: sensor
     class: carbon_monoxide
-    category: diagnostic
     dps:
       - id: 19
         type: integer