mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add translatable states to washer machine state in SmartThings (#139366)
This commit is contained in:
parent
5e5fd6a2f2
commit
92268f894a
@ -93,6 +93,8 @@ OVEN_MODE = {
|
||||
"Rinse": "rinse",
|
||||
}
|
||||
|
||||
WASHER_OPTIONS = ["pause", "run", "stop"]
|
||||
|
||||
|
||||
def power_attributes(status: dict[str, Any]) -> dict[str, Any]:
|
||||
"""Return the power attributes."""
|
||||
@ -242,7 +244,7 @@ CAPABILITY_TO_SENSORS: dict[
|
||||
SmartThingsSensorEntityDescription(
|
||||
key=Attribute.MACHINE_STATE,
|
||||
translation_key="dishwasher_machine_state",
|
||||
options=["pause", "run", "stop"],
|
||||
options=WASHER_OPTIONS,
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
)
|
||||
],
|
||||
@ -847,6 +849,8 @@ CAPABILITY_TO_SENSORS: dict[
|
||||
SmartThingsSensorEntityDescription(
|
||||
key=Attribute.MACHINE_STATE,
|
||||
translation_key="washer_machine_state",
|
||||
options=WASHER_OPTIONS,
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
)
|
||||
],
|
||||
Attribute.WASHER_JOB_STATE: [
|
||||
|
@ -326,7 +326,12 @@
|
||||
"name": "Washer mode"
|
||||
},
|
||||
"washer_machine_state": {
|
||||
"name": "[%key:component::smartthings::entity::sensor::dishwasher_machine_state::name%]"
|
||||
"name": "[%key:component::smartthings::entity::sensor::dishwasher_machine_state::name%]",
|
||||
"state": {
|
||||
"pause": "[%key:common::state::paused%]",
|
||||
"run": "[%key:component::smartthings::entity::sensor::dishwasher_machine_state::state::run%]",
|
||||
"stop": "[%key:component::smartthings::entity::sensor::dishwasher_machine_state::state::stop%]"
|
||||
}
|
||||
},
|
||||
"washer_job_state": {
|
||||
"name": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::name%]"
|
||||
|
@ -3798,7 +3798,13 @@
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'capabilities': dict({
|
||||
'options': list([
|
||||
'pause',
|
||||
'run',
|
||||
'stop',
|
||||
]),
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
@ -3816,7 +3822,7 @@
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Machine state',
|
||||
'platform': 'smartthings',
|
||||
@ -3830,7 +3836,13 @@
|
||||
# name: test_all_entities[da_wm_wm_000001][sensor.washer_machine_state-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'enum',
|
||||
'friendly_name': 'Washer Machine state',
|
||||
'options': list([
|
||||
'pause',
|
||||
'run',
|
||||
'stop',
|
||||
]),
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.washer_machine_state',
|
||||
|
Loading…
x
Reference in New Issue
Block a user