From 69c8f4fbb6e063d6a71e0ea498c37d2bb0623c65 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Wed, 26 Mar 2025 17:48:03 +0100 Subject: [PATCH] Add button to reset the water filter in SmartThings (#141493) * Add button to reset the water filter in SmartThings * Add button to reset the water filter in SmartThings --- .../components/smartthings/button.py | 5 ++ .../components/smartthings/icons.json | 3 ++ .../components/smartthings/strings.json | 3 ++ .../smartthings/snapshots/test_button.ambr | 47 +++++++++++++++++++ 4 files changed, 58 insertions(+) diff --git a/homeassistant/components/smartthings/button.py b/homeassistant/components/smartthings/button.py index fa623a47c47..00fbaa0e2c4 100644 --- a/homeassistant/components/smartthings/button.py +++ b/homeassistant/components/smartthings/button.py @@ -29,6 +29,11 @@ CAPABILITIES_TO_BUTTONS: dict[Capability | str, SmartThingsButtonDescription] = translation_key="stop", command=Command.STOP, ), + Capability.CUSTOM_WATER_FILTER: SmartThingsButtonDescription( + key=Capability.CUSTOM_WATER_FILTER, + translation_key="reset_water_filter", + command=Command.RESET_WATER_FILTER, + ), } diff --git a/homeassistant/components/smartthings/icons.json b/homeassistant/components/smartthings/icons.json index 107233665bb..214a9953a5a 100644 --- a/homeassistant/components/smartthings/icons.json +++ b/homeassistant/components/smartthings/icons.json @@ -21,6 +21,9 @@ } }, "button": { + "reset_water_filter": { + "default": "mdi:reload" + }, "stop": { "default": "mdi:stop" } diff --git a/homeassistant/components/smartthings/strings.json b/homeassistant/components/smartthings/strings.json index 441a53369b5..dfba018b8d9 100644 --- a/homeassistant/components/smartthings/strings.json +++ b/homeassistant/components/smartthings/strings.json @@ -59,6 +59,9 @@ } }, "button": { + "reset_water_filter": { + "name": "Reset water filter" + }, "stop": { "name": "[%key:common::action::stop%]" } diff --git a/tests/components/smartthings/snapshots/test_button.ambr b/tests/components/smartthings/snapshots/test_button.ambr index f1c5d932729..2c9dbd008af 100644 --- a/tests/components/smartthings/snapshots/test_button.ambr +++ b/tests/components/smartthings/snapshots/test_button.ambr @@ -140,3 +140,50 @@ 'state': 'unknown', }) # --- +# name: test_all_entities[da_ref_normal_000001][button.refrigerator_reset_water_filter-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': None, + 'entity_id': 'button.refrigerator_reset_water_filter', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Reset water filter', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'reset_water_filter', + 'unique_id': '7db87911-7dce-1cf2-7119-b953432a2f09_main_custom.waterFilter_resetWaterFilter', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da_ref_normal_000001][button.refrigerator_reset_water_filter-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Refrigerator Reset water filter', + }), + 'context': , + 'entity_id': 'button.refrigerator_reset_water_filter', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# ---