mirror of
https://github.com/home-assistant/core.git
synced 2026-02-15 07:36:16 +00:00
Add alarm_state to Tuya siren alarm (#151221)
This commit is contained in:
@@ -607,6 +607,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
|
||||
|
||||
@@ -207,6 +207,11 @@ SELECTS: dict[DeviceCategory, tuple[SelectEntityDescription, ...]] = {
|
||||
),
|
||||
),
|
||||
DeviceCategory.SGBJ: (
|
||||
SelectEntityDescription(
|
||||
key=DPCode.ALARM_STATE,
|
||||
translation_key="siren_mode",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
SelectEntityDescription(
|
||||
key=DPCode.ALARM_VOLUME,
|
||||
translation_key="volume",
|
||||
|
||||
@@ -494,6 +494,15 @@
|
||||
"power_on": "[%key:common::state::on%]"
|
||||
}
|
||||
},
|
||||
"siren_mode": {
|
||||
"name": "Siren mode",
|
||||
"state": {
|
||||
"alarm_light": "Light",
|
||||
"alarm_sound": "Sound",
|
||||
"alarm_sound_light": "Sound & light",
|
||||
"normal": "[%key:common::state::normal%]"
|
||||
}
|
||||
},
|
||||
"target_humidity": {
|
||||
"name": "Target humidity"
|
||||
},
|
||||
|
||||
@@ -4389,6 +4389,67 @@
|
||||
'state': 'power_on',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[select.siren_siren_mode-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'options': list([
|
||||
'alarm_sound',
|
||||
'alarm_light',
|
||||
'alarm_sound_light',
|
||||
'normal',
|
||||
]),
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'select',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'select.siren_siren_mode',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Siren mode',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'siren_mode',
|
||||
'unique_id': 'tuya.okwwus27jhqqe2mijbgsalarm_state',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[select.siren_siren_mode-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Siren Siren mode',
|
||||
'options': list([
|
||||
'alarm_sound',
|
||||
'alarm_light',
|
||||
'alarm_sound_light',
|
||||
'normal',
|
||||
]),
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'select.siren_siren_mode',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'normal',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[select.siren_veranda_volume-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
||||
Reference in New Issue
Block a user