From 88e630b54f95bbd6a535a0319e26a44627c41761 Mon Sep 17 00:00:00 2001 From: Marc Billow Date: Wed, 22 Jul 2026 06:11:15 +0000 Subject: [PATCH] feat: detect FlexWash (WV) washers; add combo dry-level select - WV consumer-model prefix (FlexWash twin washers, e.g. WV55M9600AW) wasn't in the by-model fallback map, so these units fell through to the unknown-device registry with zero capabilities bound (#19). - Washer/dryer combo units carry a writable dryLevel field directly on /washer/vs/0 with no separate dryer resource; add a self-gating select for it, off supportedDryLevel presence, so plain washers are unaffected (#22). --- .../localthings/registry/by_type/__init__.py | 1 + .../localthings/registry/capabilities/washer.py | 13 +++++++++++++ custom_components/localthings/strings.json | 12 ++++++++++++ custom_components/localthings/translations/en.json | 12 ++++++++++++ 4 files changed, 38 insertions(+) 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": {