From 910d2691d0ae68f6c4eb1ea28bef16ea20b87d72 Mon Sep 17 00:00:00 2001 From: jjprz Date: Mon, 16 Nov 2026 09:58:28 +0100 Subject: [PATCH] Add support for Tuya cdsxj camera category (#189888) Co-authored-by: Claude Opus 5.5 Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> --- homeassistant/components/tuya/camera.py | 1 + homeassistant/components/tuya/const.py | 5 ++ .../tuya/fixtures/cdsxj_vvslhf6u7qesficz.json | 20 +++++++ .../tuya/snapshots/test_camera.ambr | 55 +++++++++++++++++++ .../components/tuya/snapshots/test_init.ambr | 30 ++++++++++ 5 files changed, 111 insertions(+) create mode 100644 tests/components/tuya/fixtures/cdsxj_vvslhf6u7qesficz.json diff --git a/homeassistant/components/tuya/camera.py b/homeassistant/components/tuya/camera.py index 7fa7c74ceef8..6990555d7027 100644 --- a/homeassistant/components/tuya/camera.py +++ b/homeassistant/components/tuya/camera.py @@ -30,6 +30,7 @@ class TuyaCameraEntityDescription(TuyaEntityDescription, CameraEntityDescription CAMERAS: dict[DeviceCategory, TuyaCameraEntityDescription] = { + DeviceCategory.CDSXJ: TuyaCameraEntityDescription(key=""), DeviceCategory.DGHSXJ: TuyaCameraEntityDescription(key=""), DeviceCategory.SP: TuyaCameraEntityDescription(key=""), } diff --git a/homeassistant/components/tuya/const.py b/homeassistant/components/tuya/const.py index 1f52e34b0dee..0bfd96def486 100644 --- a/homeassistant/components/tuya/const.py +++ b/homeassistant/components/tuya/const.py @@ -474,6 +474,11 @@ class DeviceCategory(StrEnum): """Single Phase power meter (undocumented)""" BZYD = "bzyd" """White noise machine (undocumented)""" + CDSXJ = "cdsxj" + """Security camera (undocumented) + + see https://github.com/home-assistant/core/issues/177197 + """ CWJWQ = "cwjwq" """Smart Odor Eliminator-Pro (undocumented) diff --git a/tests/components/tuya/fixtures/cdsxj_vvslhf6u7qesficz.json b/tests/components/tuya/fixtures/cdsxj_vvslhf6u7qesficz.json new file mode 100644 index 000000000000..c1926947ab17 --- /dev/null +++ b/tests/components/tuya/fixtures/cdsxj_vvslhf6u7qesficz.json @@ -0,0 +1,20 @@ +{ + "name": "Front Gate Camera", + "category": "cdsxj", + "product_id": "vvslhf6u7qesficz", + "product_name": "NVS-IPC-I5", + "online": true, + "sub": false, + "time_zone": "+02:00", + "active_time": "2025-06-22T19:56:39+00:00", + "create_time": "2025-06-22T19:56:39+00:00", + "update_time": "2025-06-22T19:56:39+00:00", + "function": {}, + "local_strategy": {}, + "status_range": {}, + "status": {}, + "set_up": true, + "support_local": true, + "quirk": null, + "warnings": null +} diff --git a/tests/components/tuya/snapshots/test_camera.ambr b/tests/components/tuya/snapshots/test_camera.ambr index bf68a7c31dbd..a0b5810b296c 100644 --- a/tests/components/tuya/snapshots/test_camera.ambr +++ b/tests/components/tuya/snapshots/test_camera.ambr @@ -331,6 +331,61 @@ 'state': 'idle', }) # --- +# name: test_platform_setup_and_discovery[camera.front_gate_camera-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'camera', + 'entity_category': None, + 'entity_id': 'camera.front_gate_camera', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': None, + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': , + 'translation_key': None, + 'unique_id': 'tuya.zcifseq7u6fhlsvvjxsdc', + 'unit_of_measurement': None, + }) +# --- +# name: test_platform_setup_and_discovery[camera.front_gate_camera-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : '1', + : 'Tuya', + : '/api/camera_proxy/camera.front_gate_camera?token=1', + : 'Front Gate Camera', + : 'NVS-IPC-I5', + : , + }), + 'context': , + 'entity_id': 'camera.front_gate_camera', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'idle', + }) +# --- # name: test_platform_setup_and_discovery[camera.garage_camera-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/tuya/snapshots/test_init.ambr b/tests/components/tuya/snapshots/test_init.ambr index 64a312645c44..80039eb3fe11 100644 --- a/tests/components/tuya/snapshots/test_init.ambr +++ b/tests/components/tuya/snapshots/test_init.ambr @@ -10989,6 +10989,36 @@ 'via_device_id': None, }) # --- +# name: test_device_registry[zcifseq7u6fhlsvvjxsdc] + DeviceRegistryEntrySnapshot({ + 'area_id': None, + 'config_entry_id': , + 'config_subentry_id': None, + 'configuration_url': None, + 'connections': set({ + }), + 'disabled_by': None, + 'entry_type': None, + 'hw_version': None, + 'id': , + 'identifiers': set({ + tuple( + 'tuya', + 'zcifseq7u6fhlsvvjxsdc', + ), + }), + 'labels': set({ + }), + 'manufacturer': 'Tuya', + 'model': 'NVS-IPC-I5', + 'model_id': 'vvslhf6u7qesficz', + 'name': 'Front Gate Camera', + 'name_by_user': None, + 'serial_number': None, + 'sw_version': None, + 'via_device_id': None, + }) +# --- # name: test_device_registry[zf8vgiwoa07jwegtjd] DeviceRegistryEntrySnapshot({ 'area_id': None,