Add translatable states to dryer job state in SmartThings (#139370)

* Add translatable states to washer job state in SmartThings

* Add translatable states to dryer job state in Smartthings

* fix

* fix
pull/139380/head
Joost Lekkerkerker 2025-02-26 18:15:14 +01:00 committed by GitHub
parent 561b3ae21b
commit 25ee2e58a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 79 additions and 3 deletions

View File

@ -48,6 +48,10 @@ JOB_STATE_MAP = {
"aIRinse": "ai_rinse",
"aISpin": "ai_spin",
"aIWash": "ai_wash",
"aIDrying": "ai_drying",
"internalCare": "internal_care",
"continuousDehumidifying": "continuous_dehumidifying",
"thawingFrozenInside": "thawing_frozen_inside",
"delayWash": "delay_wash",
"weightSensing": "weight_sensing",
"freezeProtection": "freeze_protection",
@ -312,6 +316,25 @@ CAPABILITY_TO_SENSORS: dict[
SmartThingsSensorEntityDescription(
key=Attribute.DRYER_JOB_STATE,
translation_key="dryer_job_state",
options=[
"cooling",
"delay_wash",
"drying",
"finished",
"none",
"refreshing",
"weight_sensing",
"wrinkle_prevent",
"dehumidifying",
"ai_drying",
"sanitizing",
"internal_care",
"freeze_protection",
"continuous_dehumidifying",
"thawing_frozen_inside",
],
device_class=SensorDeviceClass.ENUM,
value_fn=lambda value: JOB_STATE_MAP.get(value, value),
)
],
Attribute.COMPLETION_TIME: [

View File

@ -112,7 +112,24 @@
}
},
"dryer_job_state": {
"name": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::name%]"
"name": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::name%]",
"state": {
"cooling": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::state::cooling%]",
"delay_wash": "[%key:component::smartthings::entity::sensor::washer_job_state::state::delay_wash%]",
"drying": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::state::drying%]",
"finished": "[%key:component::smartthings::entity::sensor::oven_job_state::state::finished%]",
"none": "[%key:component::smartthings::entity::sensor::washer_job_state::state::none%]",
"refreshing": "Refreshing",
"weight_sensing": "[%key:component::smartthings::entity::sensor::washer_job_state::state::weight_sensing%]",
"wrinkle_prevent": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::state::wrinkle_prevent%]",
"dehumidifying": "Dehumidifying",
"ai_drying": "AI drying",
"sanitizing": "Sanitizing",
"internal_care": "Internal care",
"freeze_protection": "Freeze protection",
"continuous_dehumidifying": "Continuous dehumidifying",
"thawing_frozen_inside": "Thawing frozen inside"
}
},
"equivalent_carbon_dioxide": {
"name": "Equivalent carbon dioxide"

View File

@ -3361,7 +3361,25 @@
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'capabilities': dict({
'options': list([
'cooling',
'delay_wash',
'drying',
'finished',
'none',
'refreshing',
'weight_sensing',
'wrinkle_prevent',
'dehumidifying',
'ai_drying',
'sanitizing',
'internal_care',
'freeze_protection',
'continuous_dehumidifying',
'thawing_frozen_inside',
]),
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
@ -3379,7 +3397,7 @@
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
'original_icon': None,
'original_name': 'Job state',
'platform': 'smartthings',
@ -3393,7 +3411,25 @@
# name: test_all_entities[da_wm_wd_000001][sensor.dryer_job_state-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'enum',
'friendly_name': 'Dryer Job state',
'options': list([
'cooling',
'delay_wash',
'drying',
'finished',
'none',
'refreshing',
'weight_sensing',
'wrinkle_prevent',
'dehumidifying',
'ai_drying',
'sanitizing',
'internal_care',
'freeze_protection',
'continuous_dehumidifying',
'thawing_frozen_inside',
]),
}),
'context': <ANY>,
'entity_id': 'sensor.dryer_job_state',