chore(coordinator): 🔧 parent the sub-devices with via_device_id - #779
Merged
Conversation
- Register the heat pump device explicitly in `async_setup_entry` and link heating, domestic water, cooling and ventilation to it by its registry id, replacing the deprecated `via_device` identifier tuple - `via_device` was removed from the `DeviceInfo` TypedDict in Home Assistant 2026.9, which made the old assignment a type error; the tuple form is also ambiguous now that identifiers are only unique per config entry - Raise the HACS minimum to 2026.8.0, the release that added `via_device_id`. Supporting both keys was considered and rejected: the legacy branch could never be exercised, since dev and both CI legs install current Home Assistant - Registration is its own `async_register_devices()` rather than a side effect of `get_device()`, keeping the registry write off an entity constructor and ahead of the pruning that compares against `device_infos` - Drop the now-dead `via_device` from the diagnostics redaction set; a registry id is a random hex string, unlike the tuple, which embedded the serial Resolves #770 (item 1)
- Home Assistant requires Python >=3.14.2 from 2026.7 onwards, so the 3.13 job resolved back to the newest release that still supports it - HA 2026.2.3, six releases behind, and below the 2026.8 minimum this integration now declares - That combination cannot exist on a user's system: HA >=2026.8 will not install on Python 3.13 at all, so the leg tested a configuration nobody can run - It surfaced now because `via_device_id` is unknown to HA 2026.2, which makes the device info match no known type and aborts entity setup - the same failure a manual install on an old core would hit, as documented in the README
Contributor
This was referenced Aug 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔧 What changed
The four logical sub-devices (heating, domestic water, cooling, ventilation) are now parented to the physical heat pump with
via_device_id— the device registry id — instead of the deprecatedvia_deviceidentifier tuple.The heat pump is registered explicitly in
async_setup_entryvia a newLuxtronikCoordinator.async_register_devices(), becausevia_device_idneeds the parent to exist in the registry before the children are built. That also keeps the registry write on an explicit, loop-only path instead of hiding it insideget_device(), which is called from an entity constructor.❓ Why now
Home Assistant 2026.8 added
via_device_idand deprecatedvia_device; 2026.9 removedvia_devicefrom theDeviceInfoTypedDictentirely, which makes the old assignment a basedpyright error as soon ashomeassistant-stubsreaches 2026.9. The tuple form is also ambiguous now that device identifiers are only unique per config entry.Supporting both keys behind a runtime capability check was considered and rejected:
tests/requirements-dev.txtpins no Home Assistant version and both CI legs install the current release, so a< 2026.8branch could never be executed — permanently uncovered code in a repo that enforces 100% coverage.So
hacs.jsonnow declares"homeassistant": "2026.8.0". HACS gates per release, reading thehacs.jsonof the version being downloaded, so anyone on an older core simply keeps 2026.08.29 and stops being offered updates — nothing breaks for them. That release has been marked as the last one supporting HA ≤ 2026.7, and the README now states the requirement for manual installs, which HACS does not gate.📦 Also in here
diagnostics.py: dropped the now-dead"via_device"fromTO_REDACT. A registry id is a random hex string; the tuple it replaces embedded the serial number, which is why it was redacted.device_infosis built as one map and assigned in a single step —_async_delete_legacy_devicesprunes against it, so a half-filled map would read as "these devices are gone".✅ Verification
Full gate green: 1205 tests pass, coverage stays at 100%, basedpyright 0 errors (the
via_devicetype error is gone), ruff check + format and codespell clean.Verified on a live install as well — Home Assistant 2026.9.0b4, Container install, with a device registry that already held the four devices created the old way:
Four devices, not eight, and the user-assigned names survived —
name_by_userlives on the device record, so the existing devices were adopted rather than recreated. The deprecation warnings the integration emitted on 2026.9 are gone.🧪 Tests
TestCoordinatorSubDeviceParentingcovers the parenting id, the absence of the deprecated key on all four sub-devices, the heat pump staying unparented while keeping the serial, adoption of an already-registered heat pump without duplication, and the entry-less coordinator the config flow builds.Resolves #770 (item 1). Item 2 —
DeviceEntry.config_entriesin_resolve_write_target— is untouched and still works through Home Assistant's compatibility shim, with runway to 2027.8.🤖 Generated with Claude Code