Add Bubble soak switch to SmartThings (#141139)

* Add Bubble soak switch to SmartThings

* Fix
This commit is contained in:
Joost Lekkerkerker 2025-03-24 12:43:53 +01:00 committed by GitHub
parent 1ae2cebeb1
commit 265a2ace90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 74 additions and 0 deletions

View File

@ -34,6 +34,12 @@
}
},
"switch": {
"bubble_soak": {
"default": "mdi:water-off",
"state": {
"on": "mdi:water"
}
},
"wrinkle_prevent": {
"default": "mdi:tumble-dryer",
"state": {

View File

@ -458,6 +458,9 @@
}
},
"switch": {
"bubble_soak": {
"name": "Bubble Soak"
},
"wrinkle_prevent": {
"name": "Wrinkle prevent"
}

View File

@ -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)

View File

@ -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({