From 7fe9e2a97594b7243aaefa267af6748d25bd369e Mon Sep 17 00:00:00 2001 From: Marc Billow Date: Wed, 29 Jul 2026 12:50:21 +0000 Subject: [PATCH] fix(registry): route TP1X_DA-AC-CAC boards to airconditioner (#191) The 0.16.0 device-type simplification dropped oneUiVersion detection on the assumption every device it typed was already reachable via a modelNum board token. Cassette AC units (TP1X_DA-AC-CAC-01001_0000) were the one exception -- they only ever resolved through oneUiVersion's "Air conditioner" string, since 'CAC' was never added to the board-token table -- so they silently fell back to common caps and lost their climate entity. --- .../localthings/registry/by_type/__init__.py | 3 ++- tests/test_by_type.py | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/custom_components/localthings/registry/by_type/__init__.py b/custom_components/localthings/registry/by_type/__init__.py index 9f860bd..f4f1672 100644 --- a/custom_components/localthings/registry/by_type/__init__.py +++ b/custom_components/localthings/registry/by_type/__init__.py @@ -75,13 +75,14 @@ _BOARD_TOKEN_TO_KEY: dict[str, str] = { # Air conditioners. Every one of these is a distinct board family with # the same resource surface: room (issues #37, #91), package, Korean # (#136), window (#87), 2-in-1 floor+wall (#150, #153), system/commercial - # (#52), and ARA-WW wall-mount (#115, #116, #117, #120). + # (#52), cassette (#191), and ARA-WW wall-mount (#115, #116, #117, #120). 'RAC': 'airconditioner', 'PRAC': 'airconditioner', 'KRAC': 'airconditioner', 'WAC': 'airconditioner', 'FAC': 'airconditioner', 'CAWW': 'airconditioner', + 'CAC': 'airconditioner', # issue #191 -- TP1X_DA-AC-CAC-01001_0000 'ARA': 'airconditioner', 'DHM': 'dehumidifier', # issue #88 -- target humidity, no climate 'TVTL': 'air_purifier', # issue #56 (ARTIK051) diff --git a/tests/test_by_type.py b/tests/test_by_type.py index 1d21435..3828557 100644 --- a/tests/test_by_type.py +++ b/tests/test_by_type.py @@ -238,6 +238,19 @@ class TestForDeviceByModel: assert reg is not None assert reg.name == 'airconditioner' + def test_airconditioner_via_cac_token(self): + """Issue #191: a cassette AC (TP1X_DA-AC-CAC-01001_0000) regressed to + 'unknown'/common-caps in 0.16.0 when oneUiVersion detection was + dropped -- 'CAC' had never been added to the modelNum board-token + table, only reachable before via oneUiVersion's '7.0 Air conditioner'.""" + from custom_components.localthings.registry.by_type import for_device_by_model + reg = for_device_by_model( + 'TP1X_DA-AC-CAC-01001_0000|10255541|60030748171811DF42005F2A00F2ED00', + 'TP1X_DA-AC-CAC-01001_0000', + ) + assert reg is not None + assert reg.name == 'airconditioner' + def test_dehumidifier_via_dhm_token(self): """Issue #88: a dehumidifier (AY18CG7500GED) shares the DA_AC_ board family with the room-AC models but reports no oneUiVersion and