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

feat(moes_wcmp52_camera): make privacy visible and recording controllable (#5247)

* feat(moes_wcmp52_camera): make privacy visible and recording controllable

Privacy and recording-enable are only reachable through the camera
entity: privacy can be toggled but has no visible state, and
recording-enable is visible but read-only. Add a switch for each
(Privacy on DP 105, Recording on DP 150), sharing the DPs the camera
entity already uses (as the PTZ buttons share DP 119). Additive only:
the camera entity is unchanged and nothing is renamed or removed.

Discussion: https://github.com/make-all/tuya-local/discussions/5246

Assisted-by: Claude (claude-opus-4-8), human-reviewed

* fix(moes_wcmp52_camera): move Stop zooming to controls

It had category: config, unlike the other pan/zoom buttons. Drop it so
it sits with the rest of the PTZ controls.

Assisted-by: Claude (claude-opus-4-8), human-reviewed

---------

Co-authored-by: Jason Rumney <make-all@users.noreply.github.com>
Clever Monkey 3 недель назад
Родитель
Сommit
88a6c3295f
1 измененных файлов с 17 добавлено и 1 удалено
  1. 17 1
      custom_components/tuya_local/devices/moes_wcmp52_camera.yaml

+ 17 - 1
custom_components/tuya_local/devices/moes_wcmp52_camera.yaml

@@ -21,6 +21,23 @@ entities:
       - id: 150
       - id: 150
         type: boolean
         type: boolean
         name: record
         name: record
+  # DP 105 also controls camera power (inverted there); on = privacy engaged.
+  - entity: switch
+    name: Privacy
+    icon: "mdi:eye-off"
+    dps:
+      - id: 105
+        type: boolean
+        name: switch
+  # DP 150 also drives the camera's is_recording; on = recording enabled.
+  - entity: switch
+    name: Recording
+    icon: "mdi:record-rec"
+    category: config
+    dps:
+      - id: 150
+        type: boolean
+        name: switch
   - entity: light
   - entity: light
     translation_key: indicator
     translation_key: indicator
     category: config
     category: config
@@ -395,7 +412,6 @@ entities:
   - entity: button
   - entity: button
     name: Stop zooming
     name: Stop zooming
     icon: "mdi:stop-circle-outline"
     icon: "mdi:stop-circle-outline"
-    category: config
     dps:
     dps:
       - id: 164
       - id: 164
         type: boolean
         type: boolean