diff --git a/homeassistant/components/tuya/const.py b/homeassistant/components/tuya/const.py index 49a34db9064e..4a4a2505f8c6 100644 --- a/homeassistant/components/tuya/const.py +++ b/homeassistant/components/tuya/const.py @@ -574,6 +574,8 @@ class DeviceCategory(StrEnum): """Tank Level Sensor (undocumented)""" ZNNBQ = "znnbq" """VESKA-micro inverter (undocumented)""" + ZNJDQ = "znjdq" + """Circuit breaker (undocumented)""" ZWJCY = "zwjcy" """Soil sensor - plant monitor (undocumented)""" ZNJXS = "znjxs" diff --git a/homeassistant/components/tuya/switch.py b/homeassistant/components/tuya/switch.py index ac5654416bb6..4c6e0ec3b4fe 100644 --- a/homeassistant/components/tuya/switch.py +++ b/homeassistant/components/tuya/switch.py @@ -894,6 +894,19 @@ SWITCHES: dict[DeviceCategory, tuple[SwitchEntityDescription, ...]] = { translation_key="switch", ), ), + DeviceCategory.ZNJDQ: ( + SwitchEntityDescription( + key=DPCode.SWITCH_1, + translation_key="indexed_switch", + translation_placeholders={"index": "1"}, + ), + SwitchEntityDescription( + key=DPCode.CHILD_LOCK, + translation_key="child_lock", + icon="mdi:account-lock", + entity_category=EntityCategory.CONFIG, + ), + ), DeviceCategory.ZNJXS: ( SwitchEntityDescription( key=DPCode.SWITCH, diff --git a/tests/components/tuya/snapshots/test_init.ambr b/tests/components/tuya/snapshots/test_init.ambr index 775c1434e126..94ee2b2996b3 100644 --- a/tests/components/tuya/snapshots/test_init.ambr +++ b/tests/components/tuya/snapshots/test_init.ambr @@ -5090,7 +5090,7 @@ 'labels': set({ }), 'manufacturer': 'Tuya', - 'model': '63A Smart Circuit Breaker (unsupported)', + 'model': '63A Smart Circuit Breaker', 'model_id': 'au6dqazvkxqnpaak', 'name': 'Smart Circuit Breaker', 'name_by_user': None, diff --git a/tests/components/tuya/snapshots/test_switch.ambr b/tests/components/tuya/snapshots/test_switch.ambr index dd4813264bdd..c34d82e1886e 100644 --- a/tests/components/tuya/snapshots/test_switch.ambr +++ b/tests/components/tuya/snapshots/test_switch.ambr @@ -10130,6 +10130,107 @@ 'state': 'off', }) # --- +# name: test_platform_setup_and_discovery[switch.smart_circuit_breaker_child_lock-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.smart_circuit_breaker_child_lock', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Child lock', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:account-lock', + 'original_name': 'Child lock', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'child_lock', + 'unique_id': 'tuya.kaapnqxkvzaqd6uaqdjnzchild_lock', + 'unit_of_measurement': None, + }) +# --- +# name: test_platform_setup_and_discovery[switch.smart_circuit_breaker_child_lock-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'Smart Circuit Breaker Child lock', + : 'mdi:account-lock', + }), + 'context': , + 'entity_id': 'switch.smart_circuit_breaker_child_lock', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_platform_setup_and_discovery[switch.smart_circuit_breaker_switch_1-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.smart_circuit_breaker_switch_1', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Switch 1', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Switch 1', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'indexed_switch', + 'unique_id': 'tuya.kaapnqxkvzaqd6uaqdjnzswitch_1', + 'unit_of_measurement': None, + }) +# --- +# name: test_platform_setup_and_discovery[switch.smart_circuit_breaker_switch_1-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'Smart Circuit Breaker Switch 1', + }), + 'context': , + 'entity_id': 'switch.smart_circuit_breaker_switch_1', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- # name: test_platform_setup_and_discovery[switch.smart_kettle_start-entry] EntityRegistryEntrySnapshot({ 'aliases': list([