Set options for dishwasher machine state sensor in SmartThings (#139347)

* Set options for dishwasher machine state sensor in SmartThings

* Fix
This commit is contained in:
Joost Lekkerkerker 2025-02-26 16:18:37 +01:00 committed by GitHub
parent 9262dec444
commit 37c8764426
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 3 deletions

View File

@ -195,6 +195,8 @@ CAPABILITY_TO_SENSORS: dict[
SmartThingsSensorEntityDescription( SmartThingsSensorEntityDescription(
key=Attribute.MACHINE_STATE, key=Attribute.MACHINE_STATE,
translation_key="dishwasher_machine_state", translation_key="dishwasher_machine_state",
options=["pause", "run", "stop"],
device_class=SensorDeviceClass.ENUM,
) )
], ],
Attribute.DISHWASHER_JOB_STATE: [ Attribute.DISHWASHER_JOB_STATE: [

View File

@ -69,7 +69,12 @@
} }
}, },
"dishwasher_machine_state": { "dishwasher_machine_state": {
"name": "Machine state" "name": "Machine state",
"state": {
"pause": "[%key:common::state::paused%]",
"run": "Running",
"stop": "Stopped"
}
}, },
"dishwasher_job_state": { "dishwasher_job_state": {
"name": "Job state", "name": "Job state",

View File

@ -2812,7 +2812,13 @@
'aliases': set({ 'aliases': set({
}), }),
'area_id': None, 'area_id': None,
'capabilities': None, 'capabilities': dict({
'options': list([
'pause',
'run',
'stop',
]),
}),
'config_entry_id': <ANY>, 'config_entry_id': <ANY>,
'config_subentry_id': <ANY>, 'config_subentry_id': <ANY>,
'device_class': None, 'device_class': None,
@ -2830,7 +2836,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',
@ -2844,7 +2850,13 @@
# name: test_all_entities[da_wm_dw_000001][sensor.dishwasher_machine_state-state] # name: test_all_entities[da_wm_dw_000001][sensor.dishwasher_machine_state-state]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'device_class': 'enum',
'friendly_name': 'Dishwasher Machine state', 'friendly_name': 'Dishwasher Machine state',
'options': list([
'pause',
'run',
'stop',
]),
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'sensor.dishwasher_machine_state', 'entity_id': 'sensor.dishwasher_machine_state',