1
0
mirror of https://github.com/home-assistant/core.git synced 2026-04-02 08:26:41 +01:00

Add sound detection switch to SmartThings (#164470)

This commit is contained in:
Joost Lekkerkerker
2026-02-28 20:11:13 +01:00
committed by GitHub
parent c6f8a7b7e4
commit be6ddc314c
4 changed files with 64 additions and 0 deletions

View File

@@ -219,6 +219,9 @@
"sanitizing_wash": {
"default": "mdi:lotion"
},
"sound_detection": {
"default": "mdi:home-sound-in"
},
"sound_effect": {
"default": "mdi:volume-high",
"state": {

View File

@@ -904,6 +904,9 @@
"sanitizing_wash": {
"name": "Sanitizing wash"
},
"sound_detection": {
"name": "Sound detection"
},
"sound_effect": {
"name": "Sound effect"
},

View File

@@ -170,6 +170,15 @@ CAPABILITY_TO_SWITCHES: dict[Capability | str, SmartThingsSwitchEntityDescriptio
on_command=Command.DO_NOT_DISTURB_ON,
off_command=Command.DO_NOT_DISTURB_OFF,
),
Capability.SOUND_DETECTION: SmartThingsSwitchEntityDescription(
key=Capability.SOUND_DETECTION,
translation_key="sound_detection",
status_attribute=Attribute.SOUND_DETECTION_STATE,
entity_category=EntityCategory.CONFIG,
on_key="enabled",
on_command=Command.ENABLE_SOUND_DETECTION,
off_command=Command.DISABLE_SOUND_DETECTION,
),
}
DISHWASHER_WASHING_OPTIONS_TO_SWITCHES: dict[
Attribute | str, SmartThingsDishwasherWashingOptionSwitchEntityDescription

View File

@@ -1028,6 +1028,55 @@
'state': 'on',
})
# ---
# name: test_all_entities[da_rvc_map_01011][switch.robot_vacuum_sound_detection-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'switch',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'switch.robot_vacuum_sound_detection',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Sound detection',
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Sound detection',
'platform': 'smartthings',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'sound_detection',
'unique_id': '01b28624-5907-c8bc-0325-8ad23f03a637_main_soundDetection_soundDetectionState_soundDetectionState',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[da_rvc_map_01011][switch.robot_vacuum_sound_detection-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Robot Vacuum Sound detection',
}),
'context': <ANY>,
'entity_id': 'switch.robot_vacuum_sound_detection',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_all_entities[da_rvc_normal_000001][switch.robot_vacuum-entry]
EntityRegistryEntrySnapshot({
'aliases': set({