Skip to content

Commit acc136a

Browse files
authored
Add entities for Smartthings flexwash (home-assistant#156997)
1 parent 0f12a40 commit acc136a

File tree

5 files changed

+293
-0
lines changed

5 files changed

+293
-0
lines changed

homeassistant/components/smartthings/binary_sensor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ class SmartThingsBinarySensorEntityDescription(BinarySensorEntityDescription):
129129
key=Attribute.REMOTE_CONTROL_ENABLED,
130130
translation_key="remote_control",
131131
is_on_key="true",
132+
component_translation_key={
133+
"sub": "sub_remote_control",
134+
},
132135
)
133136
},
134137
Capability.SOUND_SENSOR: {

homeassistant/components/smartthings/sensor.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,10 @@ class SmartThingsSensorEntityDescription(SensorEntityDescription):
10541054
translation_key="washer_machine_state",
10551055
options=WASHER_OPTIONS,
10561056
device_class=SensorDeviceClass.ENUM,
1057+
component_fn=lambda component: component == "sub",
1058+
component_translation_key={
1059+
"sub": "washer_sub_machine_state",
1060+
},
10571061
)
10581062
],
10591063
Attribute.WASHER_JOB_STATE: [
@@ -1080,6 +1084,10 @@ class SmartThingsSensorEntityDescription(SensorEntityDescription):
10801084
],
10811085
device_class=SensorDeviceClass.ENUM,
10821086
value_fn=lambda value: JOB_STATE_MAP.get(value, value),
1087+
component_fn=lambda component: component == "sub",
1088+
component_translation_key={
1089+
"sub": "washer_sub_job_state",
1090+
},
10831091
)
10841092
],
10851093
Attribute.COMPLETION_TIME: [
@@ -1088,6 +1096,10 @@ class SmartThingsSensorEntityDescription(SensorEntityDescription):
10881096
translation_key="completion_time",
10891097
device_class=SensorDeviceClass.TIMESTAMP,
10901098
value_fn=dt_util.parse_datetime,
1099+
component_fn=lambda component: component == "sub",
1100+
component_translation_key={
1101+
"sub": "washer_sub_completion_time",
1102+
},
10911103
)
10921104
],
10931105
},

homeassistant/components/smartthings/strings.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@
6666
"remote_control": {
6767
"name": "Remote control"
6868
},
69+
"sub_remote_control": {
70+
"name": "Upper washer remote control"
71+
},
6972
"valve": {
7073
"name": "Valve"
7174
}
@@ -640,6 +643,38 @@
640643
"washer_mode": {
641644
"name": "Washer mode"
642645
},
646+
"washer_sub_completion_time": {
647+
"name": "Upper washer completion time"
648+
},
649+
"washer_sub_job_state": {
650+
"name": "Upper washer job state",
651+
"state": {
652+
"ai_rinse": "[%key:component::smartthings::entity::sensor::washer_job_state::state::ai_rinse%]",
653+
"ai_spin": "[%key:component::smartthings::entity::sensor::washer_job_state::state::ai_spin%]",
654+
"ai_wash": "[%key:component::smartthings::entity::sensor::washer_job_state::state::ai_wash%]",
655+
"air_wash": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::state::air_wash%]",
656+
"cooling": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::state::cooling%]",
657+
"delay_wash": "[%key:component::smartthings::entity::sensor::washer_job_state::state::delay_wash%]",
658+
"drying": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::state::drying%]",
659+
"finish": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::state::finish%]",
660+
"freeze_protection": "[%key:component::smartthings::entity::sensor::washer_job_state::state::freeze_protection%]",
661+
"none": "[%key:component::smartthings::entity::sensor::washer_job_state::state::none%]",
662+
"pre_wash": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::state::pre_wash%]",
663+
"rinse": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::state::rinse%]",
664+
"spin": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::state::spin%]",
665+
"wash": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::state::wash%]",
666+
"weight_sensing": "[%key:component::smartthings::entity::sensor::washer_job_state::state::weight_sensing%]",
667+
"wrinkle_prevent": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::state::wrinkle_prevent%]"
668+
}
669+
},
670+
"washer_sub_machine_state": {
671+
"name": "Upper washer machine state",
672+
"state": {
673+
"pause": "[%key:common::state::paused%]",
674+
"run": "[%key:component::smartthings::entity::sensor::dishwasher_machine_state::state::run%]",
675+
"stop": "[%key:common::state::stopped%]"
676+
}
677+
},
643678
"water_consumption": {
644679
"name": "Water consumption"
645680
},

tests/components/smartthings/snapshots/test_binary_sensor.ambr

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3103,6 +3103,54 @@
31033103
'state': 'on',
31043104
})
31053105
# ---
3106+
# name: test_all_entities[da_wm_wm_100002][binary_sensor.washer_upper_washer_remote_control-entry]
3107+
EntityRegistryEntrySnapshot({
3108+
'aliases': set({
3109+
}),
3110+
'area_id': None,
3111+
'capabilities': None,
3112+
'config_entry_id': <ANY>,
3113+
'config_subentry_id': <ANY>,
3114+
'device_class': None,
3115+
'device_id': <ANY>,
3116+
'disabled_by': None,
3117+
'domain': 'binary_sensor',
3118+
'entity_category': None,
3119+
'entity_id': 'binary_sensor.washer_upper_washer_remote_control',
3120+
'has_entity_name': True,
3121+
'hidden_by': None,
3122+
'icon': None,
3123+
'id': <ANY>,
3124+
'labels': set({
3125+
}),
3126+
'name': None,
3127+
'options': dict({
3128+
}),
3129+
'original_device_class': None,
3130+
'original_icon': None,
3131+
'original_name': 'Upper washer remote control',
3132+
'platform': 'smartthings',
3133+
'previous_unique_id': None,
3134+
'suggested_object_id': None,
3135+
'supported_features': 0,
3136+
'translation_key': 'sub_remote_control',
3137+
'unique_id': 'C097276D-C8D4-0000-0000-000000000000_sub_remoteControlStatus_remoteControlEnabled_remoteControlEnabled',
3138+
'unit_of_measurement': None,
3139+
})
3140+
# ---
3141+
# name: test_all_entities[da_wm_wm_100002][binary_sensor.washer_upper_washer_remote_control-state]
3142+
StateSnapshot({
3143+
'attributes': ReadOnlyDict({
3144+
'friendly_name': 'Washer Upper washer remote control',
3145+
}),
3146+
'context': <ANY>,
3147+
'entity_id': 'binary_sensor.washer_upper_washer_remote_control',
3148+
'last_changed': <ANY>,
3149+
'last_reported': <ANY>,
3150+
'last_updated': <ANY>,
3151+
'state': 'on',
3152+
})
3153+
# ---
31063154
# name: test_all_entities[ecobee_sensor][binary_sensor.child_bedroom_motion-entry]
31073155
EntityRegistryEntrySnapshot({
31083156
'aliases': set({

tests/components/smartthings/snapshots/test_sensor.ambr

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14312,6 +14312,201 @@
1431214312
'state': 'run',
1431314313
})
1431414314
# ---
14315+
# name: test_all_entities[da_wm_wm_100002][sensor.washer_upper_washer_completion_time-entry]
14316+
EntityRegistryEntrySnapshot({
14317+
'aliases': set({
14318+
}),
14319+
'area_id': None,
14320+
'capabilities': None,
14321+
'config_entry_id': <ANY>,
14322+
'config_subentry_id': <ANY>,
14323+
'device_class': None,
14324+
'device_id': <ANY>,
14325+
'disabled_by': None,
14326+
'domain': 'sensor',
14327+
'entity_category': None,
14328+
'entity_id': 'sensor.washer_upper_washer_completion_time',
14329+
'has_entity_name': True,
14330+
'hidden_by': None,
14331+
'icon': None,
14332+
'id': <ANY>,
14333+
'labels': set({
14334+
}),
14335+
'name': None,
14336+
'options': dict({
14337+
}),
14338+
'original_device_class': <SensorDeviceClass.TIMESTAMP: 'timestamp'>,
14339+
'original_icon': None,
14340+
'original_name': 'Upper washer completion time',
14341+
'platform': 'smartthings',
14342+
'previous_unique_id': None,
14343+
'suggested_object_id': None,
14344+
'supported_features': 0,
14345+
'translation_key': 'washer_sub_completion_time',
14346+
'unique_id': 'C097276D-C8D4-0000-0000-000000000000_sub_washerOperatingState_completionTime_completionTime',
14347+
'unit_of_measurement': None,
14348+
})
14349+
# ---
14350+
# name: test_all_entities[da_wm_wm_100002][sensor.washer_upper_washer_completion_time-state]
14351+
StateSnapshot({
14352+
'attributes': ReadOnlyDict({
14353+
'device_class': 'timestamp',
14354+
'friendly_name': 'Washer Upper washer completion time',
14355+
}),
14356+
'context': <ANY>,
14357+
'entity_id': 'sensor.washer_upper_washer_completion_time',
14358+
'last_changed': <ANY>,
14359+
'last_reported': <ANY>,
14360+
'last_updated': <ANY>,
14361+
'state': '2025-11-14T03:10:39+00:00',
14362+
})
14363+
# ---
14364+
# name: test_all_entities[da_wm_wm_100002][sensor.washer_upper_washer_job_state-entry]
14365+
EntityRegistryEntrySnapshot({
14366+
'aliases': set({
14367+
}),
14368+
'area_id': None,
14369+
'capabilities': dict({
14370+
'options': list([
14371+
'air_wash',
14372+
'ai_rinse',
14373+
'ai_spin',
14374+
'ai_wash',
14375+
'cooling',
14376+
'delay_wash',
14377+
'drying',
14378+
'finish',
14379+
'none',
14380+
'pre_wash',
14381+
'rinse',
14382+
'spin',
14383+
'wash',
14384+
'weight_sensing',
14385+
'wrinkle_prevent',
14386+
'freeze_protection',
14387+
]),
14388+
}),
14389+
'config_entry_id': <ANY>,
14390+
'config_subentry_id': <ANY>,
14391+
'device_class': None,
14392+
'device_id': <ANY>,
14393+
'disabled_by': None,
14394+
'domain': 'sensor',
14395+
'entity_category': None,
14396+
'entity_id': 'sensor.washer_upper_washer_job_state',
14397+
'has_entity_name': True,
14398+
'hidden_by': None,
14399+
'icon': None,
14400+
'id': <ANY>,
14401+
'labels': set({
14402+
}),
14403+
'name': None,
14404+
'options': dict({
14405+
}),
14406+
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
14407+
'original_icon': None,
14408+
'original_name': 'Upper washer job state',
14409+
'platform': 'smartthings',
14410+
'previous_unique_id': None,
14411+
'suggested_object_id': None,
14412+
'supported_features': 0,
14413+
'translation_key': 'washer_sub_job_state',
14414+
'unique_id': 'C097276D-C8D4-0000-0000-000000000000_sub_washerOperatingState_washerJobState_washerJobState',
14415+
'unit_of_measurement': None,
14416+
})
14417+
# ---
14418+
# name: test_all_entities[da_wm_wm_100002][sensor.washer_upper_washer_job_state-state]
14419+
StateSnapshot({
14420+
'attributes': ReadOnlyDict({
14421+
'device_class': 'enum',
14422+
'friendly_name': 'Washer Upper washer job state',
14423+
'options': list([
14424+
'air_wash',
14425+
'ai_rinse',
14426+
'ai_spin',
14427+
'ai_wash',
14428+
'cooling',
14429+
'delay_wash',
14430+
'drying',
14431+
'finish',
14432+
'none',
14433+
'pre_wash',
14434+
'rinse',
14435+
'spin',
14436+
'wash',
14437+
'weight_sensing',
14438+
'wrinkle_prevent',
14439+
'freeze_protection',
14440+
]),
14441+
}),
14442+
'context': <ANY>,
14443+
'entity_id': 'sensor.washer_upper_washer_job_state',
14444+
'last_changed': <ANY>,
14445+
'last_reported': <ANY>,
14446+
'last_updated': <ANY>,
14447+
'state': 'none',
14448+
})
14449+
# ---
14450+
# name: test_all_entities[da_wm_wm_100002][sensor.washer_upper_washer_machine_state-entry]
14451+
EntityRegistryEntrySnapshot({
14452+
'aliases': set({
14453+
}),
14454+
'area_id': None,
14455+
'capabilities': dict({
14456+
'options': list([
14457+
'pause',
14458+
'run',
14459+
'stop',
14460+
]),
14461+
}),
14462+
'config_entry_id': <ANY>,
14463+
'config_subentry_id': <ANY>,
14464+
'device_class': None,
14465+
'device_id': <ANY>,
14466+
'disabled_by': None,
14467+
'domain': 'sensor',
14468+
'entity_category': None,
14469+
'entity_id': 'sensor.washer_upper_washer_machine_state',
14470+
'has_entity_name': True,
14471+
'hidden_by': None,
14472+
'icon': None,
14473+
'id': <ANY>,
14474+
'labels': set({
14475+
}),
14476+
'name': None,
14477+
'options': dict({
14478+
}),
14479+
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
14480+
'original_icon': None,
14481+
'original_name': 'Upper washer machine state',
14482+
'platform': 'smartthings',
14483+
'previous_unique_id': None,
14484+
'suggested_object_id': None,
14485+
'supported_features': 0,
14486+
'translation_key': 'washer_sub_machine_state',
14487+
'unique_id': 'C097276D-C8D4-0000-0000-000000000000_sub_washerOperatingState_machineState_machineState',
14488+
'unit_of_measurement': None,
14489+
})
14490+
# ---
14491+
# name: test_all_entities[da_wm_wm_100002][sensor.washer_upper_washer_machine_state-state]
14492+
StateSnapshot({
14493+
'attributes': ReadOnlyDict({
14494+
'device_class': 'enum',
14495+
'friendly_name': 'Washer Upper washer machine state',
14496+
'options': list([
14497+
'pause',
14498+
'run',
14499+
'stop',
14500+
]),
14501+
}),
14502+
'context': <ANY>,
14503+
'entity_id': 'sensor.washer_upper_washer_machine_state',
14504+
'last_changed': <ANY>,
14505+
'last_reported': <ANY>,
14506+
'last_updated': <ANY>,
14507+
'state': 'stop',
14508+
})
14509+
# ---
1431514510
# name: test_all_entities[ecobee_sensor][sensor.child_bedroom_temperature-entry]
1431614511
EntityRegistryEntrySnapshot({
1431714512
'aliases': set({

0 commit comments

Comments
 (0)