Explorar el Código

Add support for Orion SC009HA cameras.

Issue #1743
Jason Rumney hace 1 año
padre
commit
0f7cad8519

+ 1 - 0
ACKNOWLEDGEMENTS.md

@@ -718,3 +718,4 @@ Further device support has been made with the assistance of users. Please consid
 - [fotis3d](https://github.com/fotis3d) for assisting with support for Digoo HamB alarm.
 - [Igooris](https://github.com/Igooris) for contributing support for PZIOT E01 energy meter.
 - [shadowkora](https://github.com/shadowkora) for assisting with support for Moes Smart control panel mini IR/Bluetooth hub.
+- [megarch2021](https://github.com/megarch2021) for contributing support for Orion SC009HA cameras.

+ 1 - 0
DEVICES.md

@@ -728,6 +728,7 @@ port and password.
 - Kerui JS-P162 300W camera
 - LSC PTZ camera
 - Nedis outdoor camera
+- Orions SC009HA cameras
 - Pinelake BF02 birdfeeder camera
 - RL video intercom (reported unable to connect)
 

+ 13 - 0
custom_components/tuya_local/devices/lsc_ptz_camera.yaml

@@ -5,6 +5,18 @@ products:
 primary_entity:
   entity: camera
   dps:
+    - id: 105
+      type: boolean
+      optional: true
+      name: switch
+      mapping:
+        - dps_val: true
+          value: false
+        - dps_val: false
+          value: true
+        - dps_val: null
+          value: true
+          hidden: true
     - id: 134
       type: boolean
       name: motion_enable
@@ -42,6 +54,7 @@ secondary_entities:
   - entity: switch
     name: Privacy
     category: config
+    deprecated: camera switch
     icon: "mdi:incognito"
     dps:
       - id: 105

+ 189 - 0
custom_components/tuya_local/devices/orion_sc009ha_camera.yaml

@@ -0,0 +1,189 @@
+name: Indoor Camera
+products:
+  - id: uhvuchdkaimx0hfu
+    name: Orion SC009HA1
+  - id: 2g8r2qybiaxbl9xx
+    name: Orion SC009HA2
+primary_entity:
+  entity: camera
+  dps:
+    - id: 134
+      type: boolean
+      name: motion_enable
+      optional: true
+    - id: 150
+      type: boolean
+      name: record
+      optional: true
+    - id: 115
+      type: base64
+      optional: true
+      sensitive: true
+      name: snapshot
+    - id: 105
+      type: boolean
+      name: switch
+      optional: true
+      mapping:
+        - dps_val: true
+          value: false
+        - dps_val: false
+          value: true
+        - dps_val: null
+          value: true
+secondary_entities:
+  - entity: light
+    class: indicator
+    dps:
+      - id: 101
+        type: boolean
+        name: switch
+        optional: true
+  - entity: switch
+    name: Flip image
+    icon: "mdi:flip-horizontal"
+    dps:
+      - id: 103
+        type: boolean
+        name: switch
+        optional: true
+  - entity: switch
+    name: Timestamp
+    icon: "mdi:clock-time-eight"
+    dps:
+      - id: 104
+        type: boolean
+        name: switch
+        optional: true
+  - entity: select
+    name: Motion sensitivity
+    icon: "mdi:motion-sensor"
+    dps:
+      - id: 106
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: 0
+            value: Low
+          - dps_val: 1
+            value: Medium
+          - dps_val: 2
+            value: High
+          - dps_val: null
+            value: High
+  - entity: select
+    name: Night vision
+    icon: "mdi:weather-night"
+    dps:
+      - id: 108
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: 0
+            value: auto
+          - dps_val: 1
+            value: "off"
+          - dps_val: 2
+            value: "on"
+          - dps_val: null
+            value: "off"
+  - entity: button
+    name: SD format
+    icon: "mdi:micro-sd"
+    dps:
+      - id: 111
+        type: boolean
+        name: button
+        optional: true
+  - entity: button
+    name: PTZ stop
+    icon: "mdi:stop-circle"
+    dps:
+      - id: 116
+        type: boolean
+        name: button
+        optional: true
+  - entity: select
+    name: PTZ control
+    icon: "mdi:cursor-move"
+    dps:
+      - id: 119
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: 0
+            value: up
+          - dps_val: 1
+            value: right-up
+          - dps_val: 2
+            value: right
+          - dps_val: 3
+            value: right-down
+          - dps_val: 4
+            value: down
+          - dps_val: 5
+            value: left-down
+          - dps_val: 6
+            value: left
+          - dps_val: 7
+            value: left-up
+  - entity: switch
+    name: Sound detection
+    icon: "mdi:ear-hearing"
+    dps:
+      - id: 139
+        type: boolean
+        name: switch
+        optional: true
+  - entity: select
+    name: Sound sensitivity
+    icon: "mdi:ear-hearing"
+    dps:
+      - id: 140
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: 0
+            value: Low
+          - dps_val: 1
+            value: High
+        # following should be a binary_sensor, but we don't know the mapping
+        # if it is another snapshot, then it should be moved to camera and
+        # snapshot made to redirect when null
+      - id: 141
+        type: string
+        name: sensor
+        optional: true
+  - entity: select
+    name: Recording mode
+    icon: "mdi:video"
+    dps:
+      - id: 151
+        type: string
+        name: option
+        optional: true
+        mapping:
+          - dps_val: 1
+            value: Event
+          - dps_val: 2
+            value: Continuous
+  - entity: switch
+    name: Motion tracking
+    icon: "mdi:motion-sensor"
+    dps:
+      - id: 161
+        type: boolean
+        name: switch
+        optional: true
+  - entity: switch
+    name: Human filter
+    icon: "mdi:human-male-female"
+    dps:
+      - id: 170
+        type: boolean
+        name: switch
+        optional: true