From 51099ae7d67a3074c552433409148ffca9e16445 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Wed, 26 Feb 2025 17:13:02 +0100 Subject: [PATCH] Add translatable states to oven machine state (#139358) --- homeassistant/components/smartthings/sensor.py | 2 ++ .../components/smartthings/strings.json | 7 ++++++- .../smartthings/snapshots/test_sensor.ambr | 16 ++++++++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/smartthings/sensor.py b/homeassistant/components/smartthings/sensor.py index 91b9a09fd19..c05dd546623 100644 --- a/homeassistant/components/smartthings/sensor.py +++ b/homeassistant/components/smartthings/sensor.py @@ -482,6 +482,8 @@ CAPABILITY_TO_SENSORS: dict[ SmartThingsSensorEntityDescription( key=Attribute.MACHINE_STATE, translation_key="oven_machine_state", + options=["ready", "running", "paused"], + device_class=SensorDeviceClass.ENUM, ) ], Attribute.OVEN_JOB_STATE: [ diff --git a/homeassistant/components/smartthings/strings.json b/homeassistant/components/smartthings/strings.json index 5012cc9efa3..897d07961bb 100644 --- a/homeassistant/components/smartthings/strings.json +++ b/homeassistant/components/smartthings/strings.json @@ -204,7 +204,12 @@ } }, "oven_machine_state": { - "name": "[%key:component::smartthings::entity::sensor::dishwasher_machine_state::name%]" + "name": "[%key:component::smartthings::entity::sensor::dishwasher_machine_state::name%]", + "state": { + "ready": "Ready", + "running": "[%key:component::smartthings::entity::sensor::dishwasher_machine_state::state::run%]", + "paused": "[%key:common::state::paused%]" + } }, "oven_job_state": { "name": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::name%]", diff --git a/tests/components/smartthings/snapshots/test_sensor.ambr b/tests/components/smartthings/snapshots/test_sensor.ambr index dde39d8b515..1741e3ed2a1 100644 --- a/tests/components/smartthings/snapshots/test_sensor.ambr +++ b/tests/components/smartthings/snapshots/test_sensor.ambr @@ -1845,7 +1845,13 @@ 'aliases': set({ }), 'area_id': None, - 'capabilities': None, + 'capabilities': dict({ + 'options': list([ + 'ready', + 'running', + 'paused', + ]), + }), 'config_entry_id': , 'config_subentry_id': , 'device_class': None, @@ -1863,7 +1869,7 @@ 'name': None, 'options': dict({ }), - 'original_device_class': None, + 'original_device_class': , 'original_icon': None, 'original_name': 'Machine state', 'platform': 'smartthings', @@ -1877,7 +1883,13 @@ # name: test_all_entities[da_ks_microwave_0101x][sensor.microwave_machine_state-state] StateSnapshot({ 'attributes': ReadOnlyDict({ + 'device_class': 'enum', 'friendly_name': 'Microwave Machine state', + 'options': list([ + 'ready', + 'running', + 'paused', + ]), }), 'context': , 'entity_id': 'sensor.microwave_machine_state',