From 0503bda0f32644c8fa37e0ab08c7aad5fb5baf89 Mon Sep 17 00:00:00 2001 From: themaanda Date: Tue, 21 Jul 2026 16:59:16 -0500 Subject: [PATCH] Detect WF-series washer models --- .../localthings/registry/by_type/__init__.py | 1 + tests/test_by_type.py | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/custom_components/localthings/registry/by_type/__init__.py b/custom_components/localthings/registry/by_type/__init__.py index 8c9021e..d9b358a 100644 --- a/custom_components/localthings/registry/by_type/__init__.py +++ b/custom_components/localthings/registry/by_type/__init__.py @@ -68,6 +68,7 @@ def for_device(one_ui_version: str) -> Optional[DeviceRegistry]: _CONSUMER_PREFIX_TO_KEY: dict[str, str] = { 'WW': 'washer', 'WD': 'washer', + 'WF': 'washer', 'DV': 'dryer', 'DW': 'dishwasher', } diff --git a/tests/test_by_type.py b/tests/test_by_type.py index ff2caaa..511aca8 100644 --- a/tests/test_by_type.py +++ b/tests/test_by_type.py @@ -180,6 +180,16 @@ class TestForDeviceByModel: assert reg is not None assert reg.name == 'airconditioner' + def test_washer_wf_prefix(self): + """US front-load washers use the WF consumer-model prefix.""" + from custom_components.localthings.registry.by_type import for_device_by_model + reg = for_device_by_model( + 'DA_WM_TP1_21_COMMON|20313741|20010001001611244AA3021700000000', + 'DA_WM_TP1_21_COMMON_WF8900B/DC92-03129A_A0AE', + ) + assert reg is not None + assert reg.name == 'washer' + def test_unknown_model_returns_none(self): from custom_components.localthings.registry.by_type import for_device_by_model reg = for_device_by_model('SOME-UNKNOWN-BOARD', 'SOME-UNKNOWN-BOARD')