瀏覽代碼

Gautone alarm: make master_state a binary sensor.

master_state appears to be an indicator of whether the alarm is triggered.
Make it a binary sensor, device class is sound to get "Detected" and "Clear"
as the UI strings for the on/off states.

Issue #1051
Jason Rumney 2 年之前
父節點
當前提交
b3e79a9c7b
共有 1 個文件被更改,包括 14 次插入4 次删除
  1. 14 4
      custom_components/tuya_local/devices/gautone_pg103_alarm.yaml

+ 14 - 4
custom_components/tuya_local/devices/gautone_pg103_alarm.yaml

@@ -19,10 +19,6 @@ primary_entity:
           value: armed_home
         - dps_val: sos
           value: triggered
-    - id: 32
-      type: string
-      name: master_state
-      optional: true
     - id: 36
       type: string
       name: sub_class
@@ -102,3 +98,17 @@ secondary_entities:
       - id: 27
         type: boolean
         name: switch
+  - entity: binary_sensor
+    class: sound
+    name: Alarm
+    category: diagnostic
+    dps:
+      - id: 32
+        type: string
+        name: sensor
+        mapping:
+          - dps_val: normal
+            value: false
+          - dps_val: alarm
+            value: true
+