|
937 | 937 | "v201": "spa_3000_6000_tl_bl", # Only one variant |
938 | 938 | "description": "AC-coupled battery storage, no solar DC inputs", |
939 | 939 | }, |
| 940 | + |
| 941 | + # TL-XH (non-MIN variants) |
| 942 | + # Missing from this dict until v1.1.9 (Issue #361). Auto-detection assigns |
| 943 | + # tl_xh_3000_10000_v201 for DTC 5100, but with no display-name entry the options flow |
| 944 | + # could not render it: get_display_name_for_profile() fell through to the profile's |
| 945 | + # technical `name`, which is not a valid dropdown key, so vol.In() rejected the default |
| 946 | + # and the user was locked out of changing ANY option ("value must be one of [...]"). |
| 947 | + "TL-XH (3-10kW)": { |
| 948 | + "base": "tl_xh_3000_10000", |
| 949 | + "v201": "tl_xh_3000_10000_v201", |
| 950 | + "description": "Single-phase hybrid with battery, legacy 0-124 + VPP ranges", |
| 951 | + }, |
| 952 | + "TL-XH US (3-10kW)": { |
| 953 | + "base": "tl_xh_us_3000_10000", |
| 954 | + "v201": "tl_xh_us_3000_10000_v201", |
| 955 | + "description": "US single-phase hybrid with battery (split-phase)", |
| 956 | + }, |
| 957 | +} |
| 958 | + |
| 959 | +# Every INVERTER_PROFILES key MUST be reachable from PROFILE_DISPLAY_NAMES via 'base' or |
| 960 | +# 'v201'. A profile that isn't cannot be rendered by the options flow — see the TL-XH note |
| 961 | +# above. This has bitten twice (SPA in #360, TL-XH in #361), so assert it at import time |
| 962 | +# rather than waiting for a user to hit it. |
| 963 | +_ORPHANED_PROFILES = { |
| 964 | + pid for pid in INVERTER_PROFILES |
| 965 | + if not any(pid in (info["base"], info["v201"]) for info in PROFILE_DISPLAY_NAMES.values()) |
940 | 966 | } |
| 967 | +if _ORPHANED_PROFILES: # pragma: no cover — guards a developer error, not runtime state |
| 968 | + import logging as _logging |
| 969 | + _logging.getLogger(__name__).warning( |
| 970 | + "Profiles with no PROFILE_DISPLAY_NAMES entry — these cannot be selected or " |
| 971 | + "reconfigured in the options flow: %s", |
| 972 | + ", ".join(sorted(_ORPHANED_PROFILES)), |
| 973 | + ) |
941 | 974 |
|
942 | 975 |
|
943 | 976 | def resolve_profile_alias(series: str) -> str: |
|
0 commit comments