diff --git a/custom_components/localthings/registry/by_type/__init__.py b/custom_components/localthings/registry/by_type/__init__.py index d9b358a..a8ae11f 100644 --- a/custom_components/localthings/registry/by_type/__init__.py +++ b/custom_components/localthings/registry/by_type/__init__.py @@ -69,6 +69,7 @@ _CONSUMER_PREFIX_TO_KEY: dict[str, str] = { 'WW': 'washer', 'WD': 'washer', 'WF': 'washer', + 'WV': 'washer', # FlexWash twin units (e.g. WV55M9600AW) -- issue #19 'DV': 'dryer', 'DW': 'dishwasher', } diff --git a/custom_components/localthings/registry/capabilities/washer.py b/custom_components/localthings/registry/capabilities/washer.py index 14d3893..964a26c 100644 --- a/custom_components/localthings/registry/capabilities/washer.py +++ b/custom_components/localthings/registry/capabilities/washer.py @@ -82,6 +82,19 @@ WASHER_SETTINGS = Capability( options_field='x.com.samsung.da.supportedRinseCycles', write_fn=lambda p, rep, href=None: ( ['washer', 'vs', '0'], {'x.com.samsung.da.rinseCycles': p})), + # Washer/dryer combo units carry a dryLevel field on the wash + # resource itself (no separate dryer device/course) -- see issue + # #22. Self-gates off on plain washers, which never report + # supportedDryLevel. + SelectDesc(key='dry_level', field='x.com.samsung.da.dryLevel', + name='Dry level', icon='mdi:tumble-dryer', + entity_category='config', + translation_key='washer_dry_level', + options_field='x.com.samsung.da.supportedDryLevel', + exists_fn=lambda rep, resources: bool( + rep.get('x.com.samsung.da.supportedDryLevel')), + write_fn=lambda p, rep, href=None: ( + ['washer', 'vs', '0'], {'x.com.samsung.da.dryLevel': p})), ), ) diff --git a/custom_components/localthings/strings.json b/custom_components/localthings/strings.json index 2647ab0..08c7b31 100644 --- a/custom_components/localthings/strings.json +++ b/custom_components/localthings/strings.json @@ -119,6 +119,18 @@ "02": "2x", "03": "3x" } + }, + "washer_dry_level": { + "state": { + "none": "Off", + "cupboard": "Cupboard", + "30": "30 min", + "60": "1 hr", + "90": "1 hr 30", + "120": "2 hr", + "180": "3 hr", + "240": "4 hr" + } } }, "sensor": { diff --git a/custom_components/localthings/translations/en.json b/custom_components/localthings/translations/en.json index 2647ab0..08c7b31 100644 --- a/custom_components/localthings/translations/en.json +++ b/custom_components/localthings/translations/en.json @@ -119,6 +119,18 @@ "02": "2x", "03": "3x" } + }, + "washer_dry_level": { + "state": { + "none": "Off", + "cupboard": "Cupboard", + "30": "30 min", + "60": "1 hr", + "90": "1 hr 30", + "120": "2 hr", + "180": "3 hr", + "240": "4 hr" + } } }, "sensor": {