Explorar el Código

Kerui cameras: support more dps.

- support a camera switch in place of the separate "privacy" switch (logic reversed)
- add additional optional dps that were not handled in the original config

For Kerui 300W, add additional optional dp for resolution_change,
found in almost identical Fuers 5MP camera, making it a
100% match. Also add the image to the motion event as a string, as at
least the Fuers camera does not provide a usable snapshot for the
camera. Issue #2410
Jason Rumney hace 1 año
padre
commit
a8b052e193

+ 28 - 0
custom_components/tuya_local/devices/kerui_200w_camera.yaml

@@ -5,6 +5,14 @@ products:
 primary_entity:
   entity: camera
   dps:
+    - id: 105
+      type: boolean
+      name: switch
+      mapping:
+        - dps_val: true
+          value: false
+        - dps_val: false
+          value: true
     - id: 115
       name: snapshot
       type: base64
@@ -16,6 +24,10 @@ primary_entity:
     - id: 150
       name: record
       type: boolean
+    - id: 212
+      type: utf16b64
+      optional: true
+      name: push_message
 secondary_entities:
   - entity: light
     translation_key: indicator
@@ -51,6 +63,7 @@ secondary_entities:
   - entity: switch
     name: Privacy
     icon: "mdi:incognito"
+    deprecated: camera switch
     category: config
     dps:
       - id: 105
@@ -205,3 +218,18 @@ secondary_entities:
       - id: 161
         type: boolean
         name: switch
+  - entity: event
+    name: Alarm
+    dps:
+      - id: 185
+        type: string
+        name: event
+        optional: true
+        mapping:
+          - dps_val: null
+            value: null
+          - value: alert
+      - id: 185
+        type: utf16b64
+        name: message
+        optional: true

+ 30 - 2
custom_components/tuya_local/devices/kerui_300w_camera.yaml

@@ -2,9 +2,19 @@ name: Camera
 products:
   - id: 9waqosp1k5o0bqqh
     name: Kerui JS-P162 300W
+  - id: o9jlvpqqunankygf
+    name: Fuers 5MP indoor
 primary_entity:
   entity: camera
   dps:
+    - id: 105
+      name: switch
+      type: boolean
+      mapping:
+        - dps_val: true
+          value: false
+        - dps_val: false
+          value: true
     - id: 115
       name: snapshot
       type: base64
@@ -16,6 +26,14 @@ primary_entity:
     - id: 150
       name: record
       type: boolean
+    - id: 212
+      type: utf16b64
+      optional: true
+      name: push_message
+    - id: 241
+      type: string
+      optional: true
+      name: resolution_change
 secondary_entities:
   - entity: light
     translation_key: indicator
@@ -52,6 +70,7 @@ secondary_entities:
     name: Privacy
     icon: "mdi:incognito"
     category: config
+    deprecated: camera switch
     dps:
       - id: 105
         type: boolean
@@ -224,7 +243,16 @@ secondary_entities:
         type: string
         name: event
         optional: true
-        persist: false
         mapping:
           - dps_val: motion
-            value: true
+            value: detected
+      - id: 115
+        type: base64
+        optional: true
+        sensitive: true
+        name: image_details
+      - id: 185
+        type: utf16b64
+        optional: true
+        persist: false
+        name: alarm_message