Start the 5.0 integration when it is installed next to 4.x - #520
Merged
Merged
Conversation
Version 5.0 uses the domain gree_custom and moves the 4.x devices over when it starts. Home Assistant only sets up an integration that has a config entry or a YAML key, and after an update through HACS gree_custom has neither. HACS also leaves custom_components/gree in place, so this version still runs after the update. async_setup now starts gree_custom when it is installed. Nothing happens when it is not. This makes the move to 5.0 work without user action for everyone who updates to this release first.
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
Version 5.0 (branch
5.0-dev, domaingree_custom) moves a 4.x setup over when it starts: #519. But Home Assistant only sets up an integration that has a config entry or a YAML key, and after an update through HACSgree_customhas neither. HACS also leavescustom_components/greein place, so this version still runs after the update.This PR makes
async_setupstartgree_customwhen it is installed. When it is not installed, nothing happens. Users who update to this release before they update to 5.0 then move over without doing anything. Users who skip it can still start the move by opening the setup flow of 5.0.Testing
On the dev instance, with 5.0 installed next to this change:
gree_customstarted, and the devices, entities and device row moved.gree:YAML block:gree_customstarted, and the YAML was converted.gree_customdid not start. This confirms that the hook is needed.With
gree_customnot installed,async_get_integrationraisesIntegrationNotFoundand the hook returns. Ruff with default rules reports nothing.Notes
gree_customis installed.