From 7f0f038bcd59f1501feaacdf6cf7f23c1d057a60 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Wed, 25 Mar 2026 16:28:20 +0100 Subject: [PATCH] Add entities for stick vacuum cleaner to SmartThings (#166127) --- .../components/smartthings/binary_sensor.py | 19 ++ .../components/smartthings/sensor.py | 41 +++++ .../components/smartthings/strings.json | 22 +++ .../components/smartthings/switch.py | 8 + .../snapshots/test_binary_sensor.ambr | 102 +++++++++++ .../smartthings/snapshots/test_sensor.ambr | 171 ++++++++++++++++++ .../smartthings/snapshots/test_switch.ambr | 50 +++++ 7 files changed, 413 insertions(+) diff --git a/homeassistant/components/smartthings/binary_sensor.py b/homeassistant/components/smartthings/binary_sensor.py index 58dca7b83c2..947abde50f7 100644 --- a/homeassistant/components/smartthings/binary_sensor.py +++ b/homeassistant/components/smartthings/binary_sensor.py @@ -227,6 +227,25 @@ CAPABILITY_TO_SENSORS: dict[ entity_category=EntityCategory.DIAGNOSTIC, ) }, + Capability.SAMSUNG_CE_STICK_CLEANER_DUST_BAG: { + Attribute.STATUS: SmartThingsBinarySensorEntityDescription( + key=Attribute.STATUS, + is_on_key="full", + component_translation_key={ + "station": "stick_cleaner_dust_bag", + }, + device_class=BinarySensorDeviceClass.PROBLEM, + exists_fn=lambda component, _: component == "station", + ) + }, + Capability.SAMSUNG_CE_STICK_CLEANER_STICK_STATUS: { + Attribute.STATUS: SmartThingsBinarySensorEntityDescription( + key=Attribute.STATUS, + is_on_key="charging", + device_class=BinarySensorDeviceClass.BATTERY_CHARGING, + entity_category=EntityCategory.DIAGNOSTIC, + ) + }, } diff --git a/homeassistant/components/smartthings/sensor.py b/homeassistant/components/smartthings/sensor.py index 085598ba416..1f303013182 100644 --- a/homeassistant/components/smartthings/sensor.py +++ b/homeassistant/components/smartthings/sensor.py @@ -135,6 +135,14 @@ HEALTH_CONCERN = { "hazardous": "hazardous", } +STICK_CLEANER_STATUS = { + "ready": "ready", + "usingVacuum": "using_vacuum", + "emptyingDustbin": "emptying_dustbin", + "UVCleaning": "uv_cleaning", + "UVPaused": "uv_paused", +} + WASHER_OPTIONS = ["pause", "run", "stop"] @@ -1239,6 +1247,39 @@ CAPABILITY_TO_SENSORS: dict[ ) ], }, + Capability.SAMSUNG_CE_STICK_CLEANER_DUST_BAG: { + Attribute.USAGE: [ + SmartThingsSensorEntityDescription( + key=Attribute.USAGE, + translation_key="stick_cleaner_dust_bag_usage", + state_class=SensorStateClass.TOTAL_INCREASING, + entity_category=EntityCategory.DIAGNOSTIC, + component_fn=lambda component: component == "station", + ) + ] + }, + Capability.SAMSUNG_CE_STICK_CLEANER_STATUS: { + Attribute.OPERATING_STATE: [ + SmartThingsSensorEntityDescription( + key=Attribute.OPERATING_STATE, + name=None, + translation_key="stick_cleaner_operating_state", + options=list(STICK_CLEANER_STATUS.values()), + device_class=SensorDeviceClass.ENUM, + ) + ] + }, + Capability.SAMSUNG_CE_STICK_CLEANER_DUSTBIN_STATUS: { + Attribute.LAST_EMPTIED_TIME: [ + SmartThingsSensorEntityDescription( + key=Attribute.LAST_EMPTIED_TIME, + translation_key="stick_cleaner_dustbin_last_emptied", + device_class=SensorDeviceClass.TIMESTAMP, + entity_category=EntityCategory.DIAGNOSTIC, + value_fn=lambda value: dt_util.parse_datetime(value) if value else None, + ) + ] + }, } diff --git a/homeassistant/components/smartthings/strings.json b/homeassistant/components/smartthings/strings.json index 431c8457b14..6deaefceae4 100644 --- a/homeassistant/components/smartthings/strings.json +++ b/homeassistant/components/smartthings/strings.json @@ -85,6 +85,9 @@ "robot_cleaner_dust_bag": { "name": "Dust bag full" }, + "stick_cleaner_dust_bag": { + "name": "[%key:component::smartthings::entity::binary_sensor::robot_cleaner_dust_bag::name%]" + }, "stick_cleaner_status": { "name": "Stick cleaner in station" }, @@ -836,6 +839,22 @@ "tested": "[%key:component::smartthings::entity::sensor::carbon_monoxide_detector::state::tested%]" } }, + "stick_cleaner_dust_bag_usage": { + "name": "Dust bag cycles", + "unit_of_measurement": "cycles" + }, + "stick_cleaner_dustbin_last_emptied": { + "name": "Last emptied" + }, + "stick_cleaner_operating_state": { + "state": { + "emptying_dustbin": "Emptying dustbin", + "ready": "[%key:component::smartthings::entity::sensor::oven_machine_state::state::ready%]", + "using_vacuum": "Using vacuum", + "uv_cleaning": "UV cleaning", + "uv_paused": "UV paused" + } + }, "thermostat_cooling_setpoint": { "name": "Cooling setpoint" }, @@ -965,6 +984,9 @@ "dry_plus": { "name": "Dry plus" }, + "empty_dustbin": { + "name": "Empty dustbin" + }, "heated_dry": { "name": "Heated dry" }, diff --git a/homeassistant/components/smartthings/switch.py b/homeassistant/components/smartthings/switch.py index ac02d131145..fbf6ebd630f 100644 --- a/homeassistant/components/smartthings/switch.py +++ b/homeassistant/components/smartthings/switch.py @@ -188,6 +188,14 @@ CAPABILITY_TO_SWITCHES: dict[Capability | str, SmartThingsSwitchEntityDescriptio on_command=Command.ENABLE_SOUND_DETECTION, off_command=Command.DISABLE_SOUND_DETECTION, ), + Capability.SAMSUNG_CE_STICK_CLEANER_DUSTBIN_STATUS: SmartThingsSwitchEntityDescription( + key=Capability.SAMSUNG_CE_STICK_CLEANER_DUSTBIN_STATUS, + translation_key="empty_dustbin", + status_attribute=Attribute.OPERATING_STATE, + on_key="emptying", + on_command=Command.START_EMPTYING, + off_command=Command.STOP_EMPTYING, + ), } DISHWASHER_WASHING_OPTIONS_TO_SWITCHES: dict[ Attribute | str, SmartThingsDishwasherWashingOptionSwitchEntityDescription diff --git a/tests/components/smartthings/snapshots/test_binary_sensor.ambr b/tests/components/smartthings/snapshots/test_binary_sensor.ambr index 4796609a6f4..afd6ac6c19e 100644 --- a/tests/components/smartthings/snapshots/test_binary_sensor.ambr +++ b/tests/components/smartthings/snapshots/test_binary_sensor.ambr @@ -2227,6 +2227,108 @@ 'state': 'off', }) # --- +# name: test_all_entities[da_vc_stick_01001][binary_sensor.stick_vacuum_charging-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': , + 'entity_id': 'binary_sensor.stick_vacuum_charging', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Charging', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Charging', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'e1f93c0c-6fe0-c65a-a314-c8f7b163c86b_main_samsungce.stickCleanerStickStatus_status_status', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da_vc_stick_01001][binary_sensor.stick_vacuum_charging-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'battery_charging', + 'friendly_name': 'Stick vacuum Charging', + }), + 'context': , + 'entity_id': 'binary_sensor.stick_vacuum_charging', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_all_entities[da_vc_stick_01001][binary_sensor.stick_vacuum_dust_bag_full-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': None, + 'entity_id': 'binary_sensor.stick_vacuum_dust_bag_full', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Dust bag full', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Dust bag full', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'stick_cleaner_dust_bag', + 'unique_id': 'e1f93c0c-6fe0-c65a-a314-c8f7b163c86b_station_samsungce.stickCleanerDustBag_status_status', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da_vc_stick_01001][binary_sensor.stick_vacuum_dust_bag_full-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'problem', + 'friendly_name': 'Stick vacuum Dust bag full', + }), + 'context': , + 'entity_id': 'binary_sensor.stick_vacuum_dust_bag_full', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_all_entities[da_vc_stick_01001][binary_sensor.stick_vacuum_stick_cleaner_in_station-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/smartthings/snapshots/test_sensor.ambr b/tests/components/smartthings/snapshots/test_sensor.ambr index fffbf5e374c..fa4d538a389 100644 --- a/tests/components/smartthings/snapshots/test_sensor.ambr +++ b/tests/components/smartthings/snapshots/test_sensor.ambr @@ -13445,6 +13445,72 @@ 'state': 'room', }) # --- +# name: test_all_entities[da_vc_stick_01001][sensor.stick_vacuum-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'options': list([ + 'ready', + 'using_vacuum', + 'emptying_dustbin', + 'uv_cleaning', + 'uv_paused', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.stick_vacuum', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': None, + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'stick_cleaner_operating_state', + 'unique_id': 'e1f93c0c-6fe0-c65a-a314-c8f7b163c86b_main_samsungce.stickCleanerStatus_operatingState_operatingState', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da_vc_stick_01001][sensor.stick_vacuum-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'enum', + 'friendly_name': 'Stick vacuum', + 'options': list([ + 'ready', + 'using_vacuum', + 'emptying_dustbin', + 'uv_cleaning', + 'uv_paused', + ]), + }), + 'context': , + 'entity_id': 'sensor.stick_vacuum', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'ready', + }) +# --- # name: test_all_entities[da_vc_stick_01001][sensor.stick_vacuum_battery-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -13497,6 +13563,60 @@ 'state': '80', }) # --- +# name: test_all_entities[da_vc_stick_01001][sensor.stick_vacuum_dust_bag_cycles-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.stick_vacuum_dust_bag_cycles', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Dust bag cycles', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Dust bag cycles', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'stick_cleaner_dust_bag_usage', + 'unique_id': 'e1f93c0c-6fe0-c65a-a314-c8f7b163c86b_station_samsungce.stickCleanerDustBag_usage_usage', + 'unit_of_measurement': 'cycles', + }) +# --- +# name: test_all_entities[da_vc_stick_01001][sensor.stick_vacuum_dust_bag_cycles-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Stick vacuum Dust bag cycles', + 'state_class': , + 'unit_of_measurement': 'cycles', + }), + 'context': , + 'entity_id': 'sensor.stick_vacuum_dust_bag_cycles', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '343', + }) +# --- # name: test_all_entities[da_vc_stick_01001][sensor.stick_vacuum_energy-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -13671,6 +13791,57 @@ 'state': '0.0', }) # --- +# name: test_all_entities[da_vc_stick_01001][sensor.stick_vacuum_last_emptied-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.stick_vacuum_last_emptied', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Last emptied', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Last emptied', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'stick_cleaner_dustbin_last_emptied', + 'unique_id': 'e1f93c0c-6fe0-c65a-a314-c8f7b163c86b_main_samsungce.stickCleanerDustbinStatus_lastEmptiedTime_lastEmptiedTime', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da_vc_stick_01001][sensor.stick_vacuum_last_emptied-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': 'Stick vacuum Last emptied', + }), + 'context': , + 'entity_id': 'sensor.stick_vacuum_last_emptied', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '2026-03-21T15:25:00+00:00', + }) +# --- # name: test_all_entities[da_vc_stick_01001][sensor.stick_vacuum_power-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/smartthings/snapshots/test_switch.ambr b/tests/components/smartthings/snapshots/test_switch.ambr index 6699f6a9512..e49cfa85166 100644 --- a/tests/components/smartthings/snapshots/test_switch.ambr +++ b/tests/components/smartthings/snapshots/test_switch.ambr @@ -1249,6 +1249,56 @@ 'state': 'off', }) # --- +# name: test_all_entities[da_vc_stick_01001][switch.stick_vacuum_empty_dustbin-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + '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.stick_vacuum_empty_dustbin', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Empty dustbin', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Empty dustbin', + 'platform': 'smartthings', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'empty_dustbin', + 'unique_id': 'e1f93c0c-6fe0-c65a-a314-c8f7b163c86b_main_samsungce.stickCleanerDustbinStatus_operatingState_operatingState', + 'unit_of_measurement': None, + }) +# --- +# name: test_all_entities[da_vc_stick_01001][switch.stick_vacuum_empty_dustbin-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Stick vacuum Empty dustbin', + }), + 'context': , + 'entity_id': 'switch.stick_vacuum_empty_dustbin', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_all_entities[da_wm_dw_000001][switch.dishwasher_high_temp_wash-entry] EntityRegistryEntrySnapshot({ 'aliases': list([