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.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user