Add translatable states to oven machine state (#139358)

This commit is contained in:
Joost Lekkerkerker 2025-02-26 17:13:02 +01:00 committed by GitHub
parent b777c29bab
commit 51099ae7d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 3 deletions

View File

@ -482,6 +482,8 @@ CAPABILITY_TO_SENSORS: dict[
SmartThingsSensorEntityDescription( SmartThingsSensorEntityDescription(
key=Attribute.MACHINE_STATE, key=Attribute.MACHINE_STATE,
translation_key="oven_machine_state", translation_key="oven_machine_state",
options=["ready", "running", "paused"],
device_class=SensorDeviceClass.ENUM,
) )
], ],
Attribute.OVEN_JOB_STATE: [ Attribute.OVEN_JOB_STATE: [

View File

@ -204,7 +204,12 @@
} }
}, },
"oven_machine_state": { "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": { "oven_job_state": {
"name": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::name%]", "name": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::name%]",

View File

@ -1845,7 +1845,13 @@
'aliases': set({ 'aliases': set({
}), }),
'area_id': None, 'area_id': None,
'capabilities': None, 'capabilities': dict({
'options': list([
'ready',
'running',
'paused',
]),
}),
'config_entry_id': <ANY>, 'config_entry_id': <ANY>,
'config_subentry_id': <ANY>, 'config_subentry_id': <ANY>,
'device_class': None, 'device_class': None,
@ -1863,7 +1869,7 @@
'name': None, 'name': None,
'options': dict({ 'options': dict({
}), }),
'original_device_class': None, 'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
'original_icon': None, 'original_icon': None,
'original_name': 'Machine state', 'original_name': 'Machine state',
'platform': 'smartthings', 'platform': 'smartthings',
@ -1877,7 +1883,13 @@
# name: test_all_entities[da_ks_microwave_0101x][sensor.microwave_machine_state-state] # name: test_all_entities[da_ks_microwave_0101x][sensor.microwave_machine_state-state]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'device_class': 'enum',
'friendly_name': 'Microwave Machine state', 'friendly_name': 'Microwave Machine state',
'options': list([
'ready',
'running',
'paused',
]),
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'sensor.microwave_machine_state', 'entity_id': 'sensor.microwave_machine_state',