From 923300f4e7733a18100965407de1d7e96bf46381 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Wed, 30 Apr 2025 15:39:23 +0200 Subject: [PATCH] Add Sabbath mode to SmartThings (#141072) --- .../components/smartthings/strings.json | 3 ++ .../components/smartthings/switch.py | 5 ++ .../smartthings/snapshots/test_switch.ambr | 47 +++++++++++++++++++ 3 files changed, 55 insertions(+) diff --git a/homeassistant/components/smartthings/strings.json b/homeassistant/components/smartthings/strings.json index 384264b0595..f925376eea7 100644 --- a/homeassistant/components/smartthings/strings.json +++ b/homeassistant/components/smartthings/strings.json @@ -478,6 +478,9 @@ }, "ice_maker": { "name": "Ice maker" + }, + "sabbath_mode": { + "name": "Sabbath mode" } } }, diff --git a/homeassistant/components/smartthings/switch.py b/homeassistant/components/smartthings/switch.py index af019709fb9..56e67ad2a13 100644 --- a/homeassistant/components/smartthings/switch.py +++ b/homeassistant/components/smartthings/switch.py @@ -87,6 +87,11 @@ CAPABILITY_TO_SWITCHES: dict[Capability | str, SmartThingsSwitchEntityDescriptio "icemaker": "ice_maker", }, ), + Capability.SAMSUNG_CE_SABBATH_MODE: SmartThingsSwitchEntityDescription( + key=Capability.SAMSUNG_CE_SABBATH_MODE, + translation_key="sabbath_mode", + status_attribute=Attribute.STATUS, + ), } diff --git a/tests/components/smartthings/snapshots/test_switch.ambr b/tests/components/smartthings/snapshots/test_switch.ambr index be605bc7036..4245d2bb095 100644 --- a/tests/components/smartthings/snapshots/test_switch.ambr +++ b/tests/components/smartthings/snapshots/test_switch.ambr @@ -93,6 +93,53 @@ 'state': 'off', }) # --- +# name: test_all_entities[da_ref_normal_000001][switch.refrigerator_sabbath_mode-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.refrigerator_sabbath_mode', + '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': 'Sabbath mode', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'sabbath_mode', + 'unique_id': '7db87911-7dce-1cf2-7119-b953432a2f09_main_samsungce.sabbathMode_status_status', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da_ref_normal_000001][switch.refrigerator_sabbath_mode-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Refrigerator Sabbath mode', + }), + 'context': , + 'entity_id': 'switch.refrigerator_sabbath_mode', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_all_entities[da_ref_normal_01001][switch.refrigerator_ice_maker-entry] EntityRegistryEntrySnapshot({ 'aliases': set({