Просмотр исходного кода

Gautone PG103: use events for alarm and power warnings

Issue #1059
Jason Rumney 1 год назад
Родитель
Сommit
1d656a68d5
1 измененных файлов с 39 добавлено и 1 удалено
  1. 39 1
      custom_components/tuya_local/devices/gautone_pg103_alarm.yaml

+ 39 - 1
custom_components/tuya_local/devices/gautone_pg103_alarm.yaml

@@ -1,6 +1,6 @@
 name: Alarm security system
 products:
-  - id: eb26b0818666ecd284o4qe
+  - id: z75vinnyhtgxhaxw
     manufacturer: GauTone
     model: PG-103
   - id: gyitctrjj1kefxp2
@@ -105,6 +105,7 @@ entities:
         name: switch
   - entity: binary_sensor
     class: sound
+    deprecated: event.alarm
     name: Alarm
     category: diagnostic
     dps:
@@ -121,3 +122,40 @@ entities:
         name: message
         optional: true
         persist: false
+  - entity: event
+    name: Alarm
+    dps:
+      - id: 32
+        type: string
+        name: sensor
+        mapping:
+          - dps_val: normal
+            value: null
+          - dps_val: alarm
+            value: alarm
+      - id: 26
+        type: utf16b64
+        name: message
+        optional: true
+      - id: 37
+        type: string
+        optional: true
+        name: sub_type
+      - id: 39
+        type: string
+        optional: true
+        name: sub_state
+  - entity: event
+    name: Power
+    dps:
+      - id: 101
+        type: string
+        name: event
+        optional: true
+        mapping:
+          - dps_val: normal
+            value: null
+          - dps_val: powerDisconnect
+            value: power_disconnect
+          - dps_val: BatteryIsLow
+            value: low_battery