Repository navigation
Fix deprecated platform forwarding and config entry lifecycle - #8
Open
blindlight86 wants to merge 1 commit into
Open
blindlight86 wants to merge 1 commit into
blindlight86 wants to merge 1 commit into
Conversation
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.
Summary
Fixes #6.
Replace the removed single-platform forwarding API with awaited
hass.config_entries.async_forward_entry_setups(entry, PLATFORMS). The connection and initial state read now finish before platform forwarding, and forwarding finishes before entry setup returns.ConfigEntryNotReadyso Home Assistant schedules retries.entry.async_on_unloadand unload the switch platform before releasing the client.local_pushmetadata from the deprecated config-flow connection class tomanifest.json.The patch preserves configuration keys, YAML import, config-flow version, all 16 relay names, and entity unique IDs. It retains the existing boolean setup/unload return convention, which remains supported for custom integrations in Core 2026.11.
Based on current
masteratc1231928993a9ea4ad5ef492de3bef18003ed63f. The changes are limited to three integration files.Official API confirmation
Home Assistant's migration guidance requires awaiting the plural forwarding method during entry setup. The replacement reported by Elwinmage in #6 remains valid in Core 2026.11.1. The earlier compatibility PR #7 was closed without merging.
Simulation testing
Executed against real Home Assistant Core 2026.11.1 in an isolated Linux process with Python 3.14.10 and the unchanged
usr-r16==0.0.4dependency. A loopback TCP relay simulator supplied authorization replies and relay-state packets. The exercise used Home Assistant's config flows, entry lifecycle, entity registry, and switch service calls.The simulation originally passed on 2026-11-10 and was rerun successfully on 2026-11-11 for this PR.
turn_on,turn_off, andtogglecalls work.SETUP_RETRY, closes the partial connection, and recovers through Home Assistant's automatic retry when the simulator starts responding.Python compilation, manifest JSON parsing,
git diff --check, and patch applicability to a clean master checkout also passed. The error logs in the last two scenarios are expected failure injections. This simulation suite ran locally.Pending verification on a physical USR-R16
Physical-device results remain pending. The runtime checks above establish the tested Core/API and simulated lifecycle behavior.