diff --git a/homeassistant/components/tuya/const.py b/homeassistant/components/tuya/const.py index ef110334173a..d1722212ad3d 100644 --- a/homeassistant/components/tuya/const.py +++ b/homeassistant/components/tuya/const.py @@ -893,6 +893,7 @@ class DPCode(StrEnum): SWITCH_7 = "switch_7" # Switch 7 SWITCH_8 = "switch_8" # Switch 8 SWITCH_ALARM_LIGHT = "switch_alarm_light" + SWITCH_ALARM_PROPEL = "switch_alarm_propel" SWITCH_ALARM_SOUND = "switch_alarm_sound" SWITCH_BACKLIGHT = "switch_backlight" # Backlight switch SWITCH_CHARGE = "switch_charge" @@ -900,6 +901,7 @@ class DPCode(StrEnum): SWITCH_DISTURB = "switch_disturb" SWITCH_FAN = "switch_fan" SWITCH_HORIZONTAL = "switch_horizontal" # Horizontal swing flap switch + SWITCH_KB_SOUND = "switch_kb_sound" SWITCH_LED = "switch_led" # Switch SWITCH_LED_1 = "switch_led_1" SWITCH_LED_2 = "switch_led_2" diff --git a/homeassistant/components/tuya/strings.json b/homeassistant/components/tuya/strings.json index cd489fcbbde8..a5810d6c115d 100644 --- a/homeassistant/components/tuya/strings.json +++ b/homeassistant/components/tuya/strings.json @@ -1058,6 +1058,9 @@ } }, "switch": { + "alarm_push_notifications": { + "name": "Alarm push notifications" + }, "anion": { "name": "Anion" }, @@ -1121,6 +1124,9 @@ "ionizer": { "name": "Ionizer" }, + "keypad_sound": { + "name": "Keypad sound" + }, "motion_alarm": { "name": "Motion alarm" }, diff --git a/homeassistant/components/tuya/switch.py b/homeassistant/components/tuya/switch.py index 9dcb11b7aa7d..fd43ce1e3293 100644 --- a/homeassistant/components/tuya/switch.py +++ b/homeassistant/components/tuya/switch.py @@ -800,6 +800,18 @@ SWITCHES: dict[DeviceCategory, tuple[SwitchEntityDescription, ...]] = { translation_key="mute", entity_category=EntityCategory.CONFIG, ), + SwitchEntityDescription( + key=DPCode.SWITCH_KB_SOUND, + # Poorly translated as "Key tone switch of host" in the official Tuya app + translation_key="keypad_sound", + entity_category=EntityCategory.CONFIG, + ), + SwitchEntityDescription( + key=DPCode.SWITCH_ALARM_PROPEL, + # Poorly translated as "alarm push switch" in the official Tuya app + translation_key="alarm_push_notifications", + entity_category=EntityCategory.CONFIG, + ), ), DeviceCategory.WK: ( SwitchEntityDescription( diff --git a/tests/components/tuya/snapshots/test_switch.ambr b/tests/components/tuya/snapshots/test_switch.ambr index a9b7dec7b72e..37fca4dbbd3f 100644 --- a/tests/components/tuya/snapshots/test_switch.ambr +++ b/tests/components/tuya/snapshots/test_switch.ambr @@ -1820,6 +1820,106 @@ 'state': 'on', }) # --- +# name: test_platform_setup_and_discovery[switch.c30_alarm_push_notifications-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.c30_alarm_push_notifications', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Alarm push notifications', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Alarm push notifications', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'alarm_push_notifications', + 'unique_id': 'tuya.rirsc4vhpbv2whkp2gwswitch_alarm_propel', + 'unit_of_measurement': None, + }) +# --- +# name: test_platform_setup_and_discovery[switch.c30_alarm_push_notifications-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'C30 Alarm push notifications', + }), + 'context': , + 'entity_id': 'switch.c30_alarm_push_notifications', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_platform_setup_and_discovery[switch.c30_keypad_sound-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.c30_keypad_sound', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Keypad sound', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Keypad sound', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'keypad_sound', + 'unique_id': 'tuya.rirsc4vhpbv2whkp2gwswitch_kb_sound', + 'unit_of_measurement': None, + }) +# --- +# name: test_platform_setup_and_discovery[switch.c30_keypad_sound-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'C30 Keypad sound', + }), + 'context': , + 'entity_id': 'switch.c30_keypad_sound', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- # name: test_platform_setup_and_discovery[switch.c9_auto_trigger_siren-entry] EntityRegistryEntrySnapshot({ 'aliases': list([