mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Add Bubble soak switch to SmartThings (#141139)
* Add Bubble soak switch to SmartThings * Fix
This commit is contained in:
parent
1ae2cebeb1
commit
265a2ace90
@ -34,6 +34,12 @@
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
"bubble_soak": {
|
||||
"default": "mdi:water-off",
|
||||
"state": {
|
||||
"on": "mdi:water"
|
||||
}
|
||||
},
|
||||
"wrinkle_prevent": {
|
||||
"default": "mdi:tumble-dryer",
|
||||
"state": {
|
||||
|
@ -458,6 +458,9 @@
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
"bubble_soak": {
|
||||
"name": "Bubble Soak"
|
||||
},
|
||||
"wrinkle_prevent": {
|
||||
"name": "Wrinkle prevent"
|
||||
}
|
||||
|
@ -59,6 +59,13 @@ CAPABILITY_TO_COMMAND_SWITCHES: dict[
|
||||
command=Command.SET_DRYER_WRINKLE_PREVENT,
|
||||
)
|
||||
}
|
||||
CAPABILITY_TO_SWITCHES: dict[Capability | str, SmartThingsSwitchEntityDescription] = {
|
||||
Capability.SAMSUNG_CE_WASHER_BUBBLE_SOAK: SmartThingsSwitchEntityDescription(
|
||||
key=Capability.SAMSUNG_CE_WASHER_BUBBLE_SOAK,
|
||||
translation_key="bubble_soak",
|
||||
status_attribute=Attribute.STATUS,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
@ -86,6 +93,17 @@ async def async_setup_entry(
|
||||
for capability, description in CAPABILITY_TO_COMMAND_SWITCHES.items()
|
||||
if capability in device.status[MAIN]
|
||||
)
|
||||
entities.extend(
|
||||
SmartThingsSwitch(
|
||||
entry_data.client,
|
||||
device,
|
||||
description,
|
||||
Capability(capability),
|
||||
)
|
||||
for device in entry_data.devices.values()
|
||||
for capability, description in CAPABILITY_TO_SWITCHES.items()
|
||||
if capability in device.status[MAIN]
|
||||
)
|
||||
async_add_entities(entities)
|
||||
|
||||
|
||||
|
@ -516,6 +516,53 @@
|
||||
'state': 'on',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_wm_wm_000001_1][switch.washing_machine_bubble_soak-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': None,
|
||||
'entity_id': 'switch.washing_machine_bubble_soak',
|
||||
'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': 'Bubble Soak',
|
||||
'platform': 'smartthings',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'bubble_soak',
|
||||
'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_samsungce.washerBubbleSoak',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_wm_wm_000001_1][switch.washing_machine_bubble_soak-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Washing Machine Bubble Soak',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.washing_machine_bubble_soak',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[generic_ef00_v1][switch.thermostat_kuche-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
Loading…
x
Reference in New Issue
Block a user