diff --git a/homeassistant/components/tuya/const.py b/homeassistant/components/tuya/const.py index 7a80a51726d..91cf49d0991 100644 --- a/homeassistant/components/tuya/const.py +++ b/homeassistant/components/tuya/const.py @@ -103,6 +103,7 @@ class DPCode(StrEnum): ALARM_DELAY_TIME = "alarm_delay_time" ALARM_MESSAGE = "alarm_message" ALARM_MSG = "alarm_msg" + ALARM_STATE = "alarm_state" ALARM_SWITCH = "alarm_switch" # Alarm switch ALARM_TIME = "alarm_time" # Alarm time ALARM_VOLUME = "alarm_volume" # Alarm volume diff --git a/homeassistant/components/tuya/select.py b/homeassistant/components/tuya/select.py index 296a5e3cc2c..22c3998c2f3 100644 --- a/homeassistant/components/tuya/select.py +++ b/homeassistant/components/tuya/select.py @@ -237,6 +237,11 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = { # Siren Alarm # https://developer.tuya.com/en/docs/iot/categorysgbj?id=Kaiuz37tlpbnu "sgbj": ( + SelectEntityDescription( + key=DPCode.ALARM_STATE, + translation_key="alarm_state", + entity_category=EntityCategory.CONFIG, + ), SelectEntityDescription( key=DPCode.ALARM_VOLUME, translation_key="volume", diff --git a/homeassistant/components/tuya/strings.json b/homeassistant/components/tuya/strings.json index fa15e34694c..0567c91eb2c 100644 --- a/homeassistant/components/tuya/strings.json +++ b/homeassistant/components/tuya/strings.json @@ -496,6 +496,15 @@ "smart": "Smart", "interim": "Interim" } + }, + "alarm_state": { + "name": "Alarm state", + "state": { + "normal": "[%key:common::state::normal%]", + "alarm_light": "Light", + "alarm_sound": "Sound", + "alarm_sound_light": "Sound & light" + } } }, "sensor": { diff --git a/tests/components/tuya/snapshots/test_select.ambr b/tests/components/tuya/snapshots/test_select.ambr index 7c68a647040..2de739f82ed 100644 --- a/tests/components/tuya/snapshots/test_select.ambr +++ b/tests/components/tuya/snapshots/test_select.ambr @@ -3372,6 +3372,67 @@ 'state': 'power_on', }) # --- +# name: test_platform_setup_and_discovery[select.siren_alarm_state-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'options': list([ + 'alarm_sound', + 'alarm_light', + 'alarm_sound_light', + 'normal', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'select', + 'entity_category': None, + 'entity_id': 'select.siren_alarm_state', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Alarm state', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'alarm_state', + 'unique_id': 'tuya.okwwus27jhqqe2mijbgsalarm_state', + 'unit_of_measurement': None, + }) +# --- +# name: test_platform_setup_and_discovery[select.siren_alarm_state-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Siren Alarm state', + 'options': list([ + 'alarm_sound', + 'alarm_light', + 'alarm_sound_light', + 'normal', + ]), + }), + 'context': , + 'entity_id': 'select.siren_alarm_state', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'normal', + }) +# --- # name: test_platform_setup_and_discovery[select.siren_veranda_volume-entry] EntityRegistryEntrySnapshot({ 'aliases': set({