Skip to content

Commit 97de944

Browse files
authored
Add Washer Water Temperature to SmartThings (home-assistant#156980)
Co-authored-by: mik-laj <[email protected]>
1 parent c9bd87f commit 97de944

File tree

4 files changed

+273
-0
lines changed

4 files changed

+273
-0
lines changed

homeassistant/components/smartthings/icons.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,14 @@
8282
"stop": "mdi:stop"
8383
}
8484
},
85+
"soil_level": {
86+
"default": "mdi:liquid-spot"
87+
},
8588
"spin_level": {
8689
"default": "mdi:rotate-right"
90+
},
91+
"water_temperature": {
92+
"default": "mdi:water-thermometer"
8793
}
8894
},
8995
"sensor": {

homeassistant/components/smartthings/select.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,34 @@
5656
"1600": "1600",
5757
}
5858

59+
WASHER_WATER_TEMPERATURE_TO_HA = {
60+
"none": "none",
61+
"20": "20",
62+
"30": "30",
63+
"40": "40",
64+
"50": "50",
65+
"60": "60",
66+
"65": "65",
67+
"70": "70",
68+
"75": "75",
69+
"80": "80",
70+
"90": "90",
71+
"95": "95",
72+
"tapCold": "tap_cold",
73+
"cold": "cold",
74+
"cool": "cool",
75+
"ecoWarm": "eco_warm",
76+
"warm": "warm",
77+
"semiHot": "semi_hot",
78+
"hot": "hot",
79+
"extraHot": "extra_hot",
80+
"extraLow": "extra_low",
81+
"low": "low",
82+
"mediumLow": "medium_low",
83+
"medium": "medium",
84+
"high": "high",
85+
}
86+
5987

6088
@dataclass(frozen=True, kw_only=True)
6189
class SmartThingsSelectDescription(SelectEntityDescription):
@@ -147,6 +175,16 @@ class SmartThingsSelectDescription(SelectEntityDescription):
147175
options_map=WASHER_SOIL_LEVEL_TO_HA,
148176
entity_category=EntityCategory.CONFIG,
149177
),
178+
Capability.CUSTOM_WASHER_WATER_TEMPERATURE: SmartThingsSelectDescription(
179+
key=Capability.CUSTOM_WASHER_WATER_TEMPERATURE,
180+
translation_key="water_temperature",
181+
requires_remote_control_status=True,
182+
options_attribute=Attribute.SUPPORTED_WASHER_WATER_TEMPERATURE,
183+
status_attribute=Attribute.WASHER_WATER_TEMPERATURE,
184+
command=Command.SET_WASHER_WATER_TEMPERATURE,
185+
options_map=WASHER_WATER_TEMPERATURE_TO_HA,
186+
entity_category=EntityCategory.CONFIG,
187+
),
150188
}
151189

152190

homeassistant/components/smartthings/strings.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,36 @@
223223
"none": "None",
224224
"rinse_hold": "Rinse hold"
225225
}
226+
},
227+
"water_temperature": {
228+
"name": "Water temperature",
229+
"state": {
230+
"20": "20",
231+
"30": "30",
232+
"40": "40",
233+
"50": "50",
234+
"60": "60",
235+
"65": "65",
236+
"70": "70",
237+
"75": "75",
238+
"80": "80",
239+
"90": "90",
240+
"95": "95",
241+
"cold": "Cold",
242+
"cool": "Cool",
243+
"eco_warm": "Eco Warm",
244+
"extra_hot": "Extra Hot",
245+
"extra_low": "Extra Low",
246+
"high": "[%key:common::state::high%]",
247+
"hot": "Hot",
248+
"low": "[%key:common::state::low%]",
249+
"medium": "[%key:common::state::medium%]",
250+
"medium_low": "Medium Low",
251+
"none": "None",
252+
"semi_hot": "Semi Hot",
253+
"tap_cold": "Tap Cold",
254+
"warm": "Warm"
255+
}
226256
}
227257
},
228258
"sensor": {

tests/components/smartthings/snapshots/test_select.ambr

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,71 @@
713713
'state': 'high',
714714
})
715715
# ---
716+
# name: test_all_entities[da_wm_wm_000001][select.washer_water_temperature-entry]
717+
EntityRegistryEntrySnapshot({
718+
'aliases': set({
719+
}),
720+
'area_id': None,
721+
'capabilities': dict({
722+
'options': list([
723+
'none',
724+
'tap_cold',
725+
'cold',
726+
'warm',
727+
'hot',
728+
'extra_hot',
729+
]),
730+
}),
731+
'config_entry_id': <ANY>,
732+
'config_subentry_id': <ANY>,
733+
'device_class': None,
734+
'device_id': <ANY>,
735+
'disabled_by': None,
736+
'domain': 'select',
737+
'entity_category': <EntityCategory.CONFIG: 'config'>,
738+
'entity_id': 'select.washer_water_temperature',
739+
'has_entity_name': True,
740+
'hidden_by': None,
741+
'icon': None,
742+
'id': <ANY>,
743+
'labels': set({
744+
}),
745+
'name': None,
746+
'options': dict({
747+
}),
748+
'original_device_class': None,
749+
'original_icon': None,
750+
'original_name': 'Water temperature',
751+
'platform': 'smartthings',
752+
'previous_unique_id': None,
753+
'suggested_object_id': None,
754+
'supported_features': 0,
755+
'translation_key': 'water_temperature',
756+
'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_custom.washerWaterTemperature_washerWaterTemperature_washerWaterTemperature',
757+
'unit_of_measurement': None,
758+
})
759+
# ---
760+
# name: test_all_entities[da_wm_wm_000001][select.washer_water_temperature-state]
761+
StateSnapshot({
762+
'attributes': ReadOnlyDict({
763+
'friendly_name': 'Washer Water temperature',
764+
'options': list([
765+
'none',
766+
'tap_cold',
767+
'cold',
768+
'warm',
769+
'hot',
770+
'extra_hot',
771+
]),
772+
}),
773+
'context': <ANY>,
774+
'entity_id': 'select.washer_water_temperature',
775+
'last_changed': <ANY>,
776+
'last_reported': <ANY>,
777+
'last_updated': <ANY>,
778+
'state': 'warm',
779+
})
780+
# ---
716781
# name: test_all_entities[da_wm_wm_000001_1][select.washing_machine-entry]
717782
EntityRegistryEntrySnapshot({
718783
'aliases': set({
@@ -839,6 +904,73 @@
839904
'state': '1400',
840905
})
841906
# ---
907+
# name: test_all_entities[da_wm_wm_000001_1][select.washing_machine_water_temperature-entry]
908+
EntityRegistryEntrySnapshot({
909+
'aliases': set({
910+
}),
911+
'area_id': None,
912+
'capabilities': dict({
913+
'options': list([
914+
'none',
915+
'cold',
916+
'20',
917+
'30',
918+
'40',
919+
'60',
920+
'90',
921+
]),
922+
}),
923+
'config_entry_id': <ANY>,
924+
'config_subentry_id': <ANY>,
925+
'device_class': None,
926+
'device_id': <ANY>,
927+
'disabled_by': None,
928+
'domain': 'select',
929+
'entity_category': <EntityCategory.CONFIG: 'config'>,
930+
'entity_id': 'select.washing_machine_water_temperature',
931+
'has_entity_name': True,
932+
'hidden_by': None,
933+
'icon': None,
934+
'id': <ANY>,
935+
'labels': set({
936+
}),
937+
'name': None,
938+
'options': dict({
939+
}),
940+
'original_device_class': None,
941+
'original_icon': None,
942+
'original_name': 'Water temperature',
943+
'platform': 'smartthings',
944+
'previous_unique_id': None,
945+
'suggested_object_id': None,
946+
'supported_features': 0,
947+
'translation_key': 'water_temperature',
948+
'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_custom.washerWaterTemperature_washerWaterTemperature_washerWaterTemperature',
949+
'unit_of_measurement': None,
950+
})
951+
# ---
952+
# name: test_all_entities[da_wm_wm_000001_1][select.washing_machine_water_temperature-state]
953+
StateSnapshot({
954+
'attributes': ReadOnlyDict({
955+
'friendly_name': 'Washing Machine Water temperature',
956+
'options': list([
957+
'none',
958+
'cold',
959+
'20',
960+
'30',
961+
'40',
962+
'60',
963+
'90',
964+
]),
965+
}),
966+
'context': <ANY>,
967+
'entity_id': 'select.washing_machine_water_temperature',
968+
'last_changed': <ANY>,
969+
'last_reported': <ANY>,
970+
'last_updated': <ANY>,
971+
'state': '40',
972+
})
973+
# ---
842974
# name: test_all_entities[da_wm_wm_01011][select.machine_a_laver-entry]
843975
EntityRegistryEntrySnapshot({
844976
'aliases': set({
@@ -1087,6 +1219,73 @@
10871219
'state': '1000',
10881220
})
10891221
# ---
1222+
# name: test_all_entities[da_wm_wm_01011][select.machine_a_laver_water_temperature-entry]
1223+
EntityRegistryEntrySnapshot({
1224+
'aliases': set({
1225+
}),
1226+
'area_id': None,
1227+
'capabilities': dict({
1228+
'options': list([
1229+
'none',
1230+
'cold',
1231+
'20',
1232+
'30',
1233+
'40',
1234+
'60',
1235+
'90',
1236+
]),
1237+
}),
1238+
'config_entry_id': <ANY>,
1239+
'config_subentry_id': <ANY>,
1240+
'device_class': None,
1241+
'device_id': <ANY>,
1242+
'disabled_by': None,
1243+
'domain': 'select',
1244+
'entity_category': <EntityCategory.CONFIG: 'config'>,
1245+
'entity_id': 'select.machine_a_laver_water_temperature',
1246+
'has_entity_name': True,
1247+
'hidden_by': None,
1248+
'icon': None,
1249+
'id': <ANY>,
1250+
'labels': set({
1251+
}),
1252+
'name': None,
1253+
'options': dict({
1254+
}),
1255+
'original_device_class': None,
1256+
'original_icon': None,
1257+
'original_name': 'Water temperature',
1258+
'platform': 'smartthings',
1259+
'previous_unique_id': None,
1260+
'suggested_object_id': None,
1261+
'supported_features': 0,
1262+
'translation_key': 'water_temperature',
1263+
'unique_id': 'b854ca5f-dc54-140d-6349-758b4d973c41_main_custom.washerWaterTemperature_washerWaterTemperature_washerWaterTemperature',
1264+
'unit_of_measurement': None,
1265+
})
1266+
# ---
1267+
# name: test_all_entities[da_wm_wm_01011][select.machine_a_laver_water_temperature-state]
1268+
StateSnapshot({
1269+
'attributes': ReadOnlyDict({
1270+
'friendly_name': 'Machine à Laver Water temperature',
1271+
'options': list([
1272+
'none',
1273+
'cold',
1274+
'20',
1275+
'30',
1276+
'40',
1277+
'60',
1278+
'90',
1279+
]),
1280+
}),
1281+
'context': <ANY>,
1282+
'entity_id': 'select.machine_a_laver_water_temperature',
1283+
'last_changed': <ANY>,
1284+
'last_reported': <ANY>,
1285+
'last_updated': <ANY>,
1286+
'state': '40',
1287+
})
1288+
# ---
10901289
# name: test_all_entities[da_wm_wm_100001][select.washer-entry]
10911290
EntityRegistryEntrySnapshot({
10921291
'aliases': set({

0 commit comments

Comments
 (0)