From 5e5fd6a2f2810896d1e63457d6ba2d67c915639f Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Wed, 26 Feb 2025 17:33:13 +0100 Subject: [PATCH] Add translatable states to robot cleaner cleaning mode in SmartThings (#139362) * Add translatable states to robot cleaner cleaning mode in SmartThings * Update homeassistant/components/smartthings/strings.json * Update homeassistant/components/smartthings/strings.json --------- Co-authored-by: Josef Zweck --- .../components/smartthings/sensor.py | 2 ++ .../components/smartthings/strings.json | 10 ++++++++- .../smartthings/snapshots/test_sensor.ambr | 22 +++++++++++++++++-- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/smartthings/sensor.py b/homeassistant/components/smartthings/sensor.py index c11ce51ceaa..f5c9fa823f0 100644 --- a/homeassistant/components/smartthings/sensor.py +++ b/homeassistant/components/smartthings/sensor.py @@ -620,6 +620,8 @@ CAPABILITY_TO_SENSORS: dict[ SmartThingsSensorEntityDescription( key=Attribute.ROBOT_CLEANER_CLEANING_MODE, translation_key="robot_cleaner_cleaning_mode", + options=["auto", "part", "repeat", "manual", "stop", "map"], + device_class=SensorDeviceClass.ENUM, entity_category=EntityCategory.DIAGNOSTIC, ) ], diff --git a/homeassistant/components/smartthings/strings.json b/homeassistant/components/smartthings/strings.json index a5335be616e..0fdb705091d 100644 --- a/homeassistant/components/smartthings/strings.json +++ b/homeassistant/components/smartthings/strings.json @@ -252,7 +252,15 @@ "name": "[%key:component::smartthings::entity::sensor::oven_setpoint::name%]" }, "robot_cleaner_cleaning_mode": { - "name": "Cleaning mode" + "name": "Cleaning mode", + "state": { + "auto": "Auto", + "part": "Partial", + "repeat": "Repeat", + "manual": "Manual", + "stop": "[%key:common::action::stop%]", + "map": "Map" + } }, "robot_cleaner_movement": { "name": "Movement", diff --git a/tests/components/smartthings/snapshots/test_sensor.ambr b/tests/components/smartthings/snapshots/test_sensor.ambr index 4db096fdb22..22a67538098 100644 --- a/tests/components/smartthings/snapshots/test_sensor.ambr +++ b/tests/components/smartthings/snapshots/test_sensor.ambr @@ -2516,7 +2516,16 @@ 'aliases': set({ }), 'area_id': None, - 'capabilities': None, + 'capabilities': dict({ + 'options': list([ + 'auto', + 'part', + 'repeat', + 'manual', + 'stop', + 'map', + ]), + }), 'config_entry_id': , 'config_subentry_id': , 'device_class': None, @@ -2534,7 +2543,7 @@ 'name': None, 'options': dict({ }), - 'original_device_class': None, + 'original_device_class': , 'original_icon': None, 'original_name': 'Cleaning mode', 'platform': 'smartthings', @@ -2548,7 +2557,16 @@ # name: test_all_entities[da_rvc_normal_000001][sensor.robot_vacuum_cleaning_mode-state] StateSnapshot({ 'attributes': ReadOnlyDict({ + 'device_class': 'enum', 'friendly_name': 'Robot vacuum Cleaning mode', + 'options': list([ + 'auto', + 'part', + 'repeat', + 'manual', + 'stop', + 'map', + ]), }), 'context': , 'entity_id': 'sensor.robot_vacuum_cleaning_mode',