Explorar el Código

ZX G30: change some entity types

- alarm duration number, alarm sound switch changed to a siren entity.
- tamper switch changed to binary sensor with tamper class.
- battery number changed to sensor with battery class.
- low battery alarm switch changed to binary sensor with battery class.

Unchanged, but unsure if it maybe should be a binary_sensor:
- alarm notification switch.
    I am not sure whether this is a switch to toggle SMS notifications,
    or a binary sensor that indicates a notification.

PR #490
Jason Rumney hace 3 años
padre
commit
6ab556967e
Se han modificado 3 ficheros con 23 adiciones y 22 borrados
  1. 1 0
      ACKNOWLEDGEMENTS.md
  2. 1 0
      DEVICES.md
  3. 21 22
      custom_components/tuya_local/devices/zx_g30_alarm.yaml

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -206,3 +206,4 @@ Further device support has been made with the assistance of users.  Please consi
 - [launchm](https://github.com/launchm) for assisting with support for Asakuki aroma diffusers.
 - [ajvandr](https://github.com/ajvandr) for assisting with support for Arlec temperature and humidity smart switches.
 - [denveronly](https://github.com/denveronly) for assisting with support for Dooya curtain motors.
+- [pasqualehun](https://github/com/pasqualehun) for contributing support for ZX-G30 alarm systems.

+ 1 - 0
DEVICES.md

@@ -319,3 +319,4 @@ of device.
 - Qoto 03 smart water valve / sprinkler controller
 - SD123 HPR01 human presence radar
 - Universal remote control (supports sensors only)
+- ZX-G30 alarm system (not as an alarm_control_panel, as individual inputs and sensors)

+ 21 - 22
custom_components/tuya_local/devices/zx_g30_alarm.yaml

@@ -46,34 +46,33 @@ secondary_entities:
         range:
           min: 0
           max: 300
-  - entity: number
-    name: Alarm duration
-    category: config
-    icon: "mdi:timer"
+  - entity: siren
+    name: Alarm
     dps:
       - id: 3
         type: integer
-        name: value
+        name: duration
         unit: min
         range:
           min: 1
           max: 60
-  - entity: switch
-    name: Alarm sound
-    category: config
-    icon: "mdi:volume-high"
-    dps:
       - id: 4
         type: boolean
-        name: switch
-  - entity: switch
+        name: tone
+        mapping:
+          - dps_val: false
+            value: "off"
+          - dps_val: true
+            value: "on"
+            default: true
+  - entity: binary_sensor
     name: Tamper
+    class: tamper
     category: config
-    icon: "mdi:alert-circle-outline"
     dps:
       - id: 9
         type: boolean
-        name: switch
+        name: sensor
   - entity: switch
     name: Arm/disarm voice prompt
     category: config
@@ -90,23 +89,23 @@ secondary_entities:
       - id: 15
         type: boolean
         name: switch
-  - entity: number
+  - entity: sensor
     name: Battery
+    class: battery
     category: config
-    icon: "mdi:battery"
     dps:
       - id: 16
         type: integer
-        name: value
+        name: sensor
         unit: "%"
-  - entity: switch
-    name: Sensor low battery alarm
+  - entity: binary_sensor
+    name: Low battery alarm
+    class: battery
     category: config
-    icon: "mdi:battery-low"
     dps:
       - id: 17
         type: boolean
-        name: switch
+        name: sensor
   - entity: switch
     name: Alarm notification
     category: config
@@ -131,4 +130,4 @@ secondary_entities:
     dps:
       - id: 29
         type: boolean
-        name: switch
+        name: switch