Skip to content

Commit b87b5cf

Browse files
authored
SmartThings: Expose the entity to control the AC unit beep (#151546)
1 parent bb44987 commit b87b5cf

File tree

5 files changed

+118
-0
lines changed

5 files changed

+118
-0
lines changed

homeassistant/components/smartthings/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,9 @@ def create_devices(
505505
Capability.SAMSUNG_CE_AIR_CONDITIONER_LIGHTING: (
506506
lambda status: status[Attribute.LIGHTING].value is not None
507507
),
508+
Capability.SAMSUNG_CE_AIR_CONDITIONER_BEEP: (
509+
lambda status: status[Attribute.BEEP].value is not None
510+
),
508511
}
509512

510513

homeassistant/components/smartthings/icons.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@
156156
"sanitize": {
157157
"default": "mdi:lotion"
158158
},
159+
"sound_effect": {
160+
"default": "mdi:volume-high",
161+
"state": {
162+
"off": "mdi:volume-off",
163+
"on": "mdi:volume-high"
164+
}
165+
},
159166
"wrinkle_prevent": {
160167
"default": "mdi:tumble-dryer",
161168
"state": {

homeassistant/components/smartthings/strings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,9 @@
653653
"sanitize": {
654654
"name": "Sanitize"
655655
},
656+
"sound_effect": {
657+
"name": "Sound effect"
658+
},
656659
"wrinkle_prevent": {
657660
"name": "Wrinkle prevent"
658661
}

homeassistant/components/smartthings/switch.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ class SmartThingsCommandSwitchEntityDescription(SmartThingsSwitchEntityDescripti
9191
),
9292
}
9393
CAPABILITY_TO_SWITCHES: dict[Capability | str, SmartThingsSwitchEntityDescription] = {
94+
Capability.SAMSUNG_CE_AIR_CONDITIONER_BEEP: SmartThingsSwitchEntityDescription(
95+
key=Capability.SAMSUNG_CE_AIR_CONDITIONER_BEEP,
96+
translation_key="sound_effect",
97+
status_attribute=Attribute.BEEP,
98+
on_key="on",
99+
on_command=Command.ON,
100+
off_command=Command.OFF,
101+
entity_category=EntityCategory.CONFIG,
102+
),
94103
Capability.SAMSUNG_CE_WASHER_BUBBLE_SOAK: SmartThingsSwitchEntityDescription(
95104
key=Capability.SAMSUNG_CE_WASHER_BUBBLE_SOAK,
96105
translation_key="bubble_soak",

tests/components/smartthings/snapshots/test_switch.ambr

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,54 @@
4747
'state': 'on',
4848
})
4949
# ---
50+
# name: test_all_entities[da_ac_cac_01001][switch.ar_varanda_sound_effect-entry]
51+
EntityRegistryEntrySnapshot({
52+
'aliases': set({
53+
}),
54+
'area_id': None,
55+
'capabilities': None,
56+
'config_entry_id': <ANY>,
57+
'config_subentry_id': <ANY>,
58+
'device_class': None,
59+
'device_id': <ANY>,
60+
'disabled_by': None,
61+
'domain': 'switch',
62+
'entity_category': <EntityCategory.CONFIG: 'config'>,
63+
'entity_id': 'switch.ar_varanda_sound_effect',
64+
'has_entity_name': True,
65+
'hidden_by': None,
66+
'icon': None,
67+
'id': <ANY>,
68+
'labels': set({
69+
}),
70+
'name': None,
71+
'options': dict({
72+
}),
73+
'original_device_class': None,
74+
'original_icon': None,
75+
'original_name': 'Sound effect',
76+
'platform': 'smartthings',
77+
'previous_unique_id': None,
78+
'suggested_object_id': None,
79+
'supported_features': 0,
80+
'translation_key': 'sound_effect',
81+
'unique_id': '23c6d296-4656-20d8-f6eb-2ff13e041753_main_samsungce.airConditionerBeep_beep_beep',
82+
'unit_of_measurement': None,
83+
})
84+
# ---
85+
# name: test_all_entities[da_ac_cac_01001][switch.ar_varanda_sound_effect-state]
86+
StateSnapshot({
87+
'attributes': ReadOnlyDict({
88+
'friendly_name': 'Ar Varanda Sound effect',
89+
}),
90+
'context': <ANY>,
91+
'entity_id': 'switch.ar_varanda_sound_effect',
92+
'last_changed': <ANY>,
93+
'last_reported': <ANY>,
94+
'last_updated': <ANY>,
95+
'state': 'on',
96+
})
97+
# ---
5098
# name: test_all_entities[da_ac_rac_01001][switch.aire_dormitorio_principal_display_lighting-entry]
5199
EntityRegistryEntrySnapshot({
52100
'aliases': set({
@@ -95,6 +143,54 @@
95143
'state': 'on',
96144
})
97145
# ---
146+
# name: test_all_entities[da_ac_rac_01001][switch.aire_dormitorio_principal_sound_effect-entry]
147+
EntityRegistryEntrySnapshot({
148+
'aliases': set({
149+
}),
150+
'area_id': None,
151+
'capabilities': None,
152+
'config_entry_id': <ANY>,
153+
'config_subentry_id': <ANY>,
154+
'device_class': None,
155+
'device_id': <ANY>,
156+
'disabled_by': None,
157+
'domain': 'switch',
158+
'entity_category': <EntityCategory.CONFIG: 'config'>,
159+
'entity_id': 'switch.aire_dormitorio_principal_sound_effect',
160+
'has_entity_name': True,
161+
'hidden_by': None,
162+
'icon': None,
163+
'id': <ANY>,
164+
'labels': set({
165+
}),
166+
'name': None,
167+
'options': dict({
168+
}),
169+
'original_device_class': None,
170+
'original_icon': None,
171+
'original_name': 'Sound effect',
172+
'platform': 'smartthings',
173+
'previous_unique_id': None,
174+
'suggested_object_id': None,
175+
'supported_features': 0,
176+
'translation_key': 'sound_effect',
177+
'unique_id': '4ece486b-89db-f06a-d54d-748b676b4d8e_main_samsungce.airConditionerBeep_beep_beep',
178+
'unit_of_measurement': None,
179+
})
180+
# ---
181+
# name: test_all_entities[da_ac_rac_01001][switch.aire_dormitorio_principal_sound_effect-state]
182+
StateSnapshot({
183+
'attributes': ReadOnlyDict({
184+
'friendly_name': 'Aire Dormitorio Principal Sound effect',
185+
}),
186+
'context': <ANY>,
187+
'entity_id': 'switch.aire_dormitorio_principal_sound_effect',
188+
'last_changed': <ANY>,
189+
'last_reported': <ANY>,
190+
'last_updated': <ANY>,
191+
'state': 'off',
192+
})
193+
# ---
98194
# name: test_all_entities[da_ref_normal_000001][switch.refrigerator_cubed_ice-entry]
99195
EntityRegistryEntrySnapshot({
100196
'aliases': set({

0 commit comments

Comments
 (0)