Closed emontnemery closed 2 days ago
The update introduces a flag to determine if entities need to be recreated when a repository is missing in the HACS feature. It improves error handling by checking the repository's existence and conditionally recreating entities if necessary. The changes also reflect corresponding test updates to verify the new behavior, ensuring that HACS updates and integration functionality are accurately maintained.
File(s) | Change Summary |
---|---|
custom_components/hacs/base.py |
Added flag (should_recreate_entities ) and logic to trigger entity recreation if repository is None |
tests/snapshots/.../test_discard_invalid_repo_data.json tests/snapshots/.../test_remove_repository_post.json tests/snapshots/.../test_remove_repository_pre.json tests/snapshots/.../test_update_repository_websocket.json |
Added new entity with attributes related to HACS update information |
tests/snapshots/test_integration_setup.json |
Added an entity with attributes related to HACS integration setup |
sequenceDiagram
participant User
participant HACS as HACS Component
participant GitHubRepo as GitHub Repository
participant Entities as HACS Entities
User ->> HACS: Load HACS from GitHub
HACS ->> GitHubRepo: Check repository's existence
alt Repository does not exist
GitHubRepo -->> HACS: Repository Not Found (None)
HACS ->> HACS: Set should_recreate_entities = True
HACS ->> Entities: Recreate Entities
else Repository exists
GitHubRepo -->> HACS: Repository Found
end
HACS -->> User: HACS Loaded
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Fix update entity missing after installing HACS
This fixes a bug where no update entity was created for the HACS repository until after a core restart or after configuring another repoository.
Needs https://github.com/hacs/integration/pull/3844 for tests to pass