From 75f2be7aaf63c3f964dc93ea7fbabd49b4a0dbf5 Mon Sep 17 00:00:00 2001 From: perseus177 Date: Tue, 28 Jul 2026 02:28:13 +0200 Subject: [PATCH] fix(registry): resolve ARTIK051_KRAC_18K to the airconditioner registry Room air conditioners on the ARTIK051 board (ARTIK051_KRAC_18K, issue #136) report no oneUiVersion and carry a '_KRAC_' token in modelNum. The existing '_RAC_' check can't see it -- the 'K' sits between the underscore and 'RAC' -- and the consumer-prefix fallback only covers washers/dryers/dishwashers, so these units fell back to 'unknown': 8 of their 19 resources ended up unbound and the device exposed nothing but a power switch. Same ARTIK051 board family as the '_TVTL_' air purifier handled just below. --- .../localthings/registry/by_type/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/custom_components/localthings/registry/by_type/__init__.py b/custom_components/localthings/registry/by_type/__init__.py index 4803a26..1a9b9aa 100644 --- a/custom_components/localthings/registry/by_type/__init__.py +++ b/custom_components/localthings/registry/by_type/__init__.py @@ -212,6 +212,14 @@ def for_device_by_model(model_num: str, description: str) -> Optional[DeviceRegi key = 'airconditioner' # Air purifiers (e.g. ARTIK051_TVTL_18K, issue #56) report no # oneUiVersion either, and carry the '_TVTL_' board-family token. + # Room air conditioners on the ARTIK051 board (e.g. ARTIK051_KRAC_18K, + # issue #136) report no oneUiVersion and carry a '_KRAC_' token. The '_RAC_' + # check above cannot see it -- the 'K' sits between the underscore and 'RAC' -- + # and the consumer-prefix fallback only covers washers/dryers/dishwashers, so + # these units fell back to 'unknown' and exposed nothing but power. Same + # ARTIK051 board family as the '_TVTL_' air purifier below. + if key is None and '_KRAC_' in (model_num or ''): + key = 'airconditioner' if key is None and '_TVTL_' in (model_num or ''): key = 'air_purifier' model_identity = f'{model_num} {description}'.upper()