Skip to content

Trigger auto-update throuogh Core service call #5834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

agners
Copy link
Member

@agners agners commented Apr 23, 2025

Proposed change

Instead of auto-updating add-ons on Supervisor side trigger an update through Core via a WebSocket service call. This makes sure that the backup is categorized correctly and all backup features like retention are applied.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to the supervisor)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to cli pull request:
  • Link to client library pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Ruff (ruff format supervisor tests)
  • Tests have been added to verify that the new code works.

If API endpoints or add-on configuration are added/changed:

Instead of auto-updating add-ons on Supervisor side trigger an update
through Core via a WebSocket service call. This makes sure that the
backup is categorized correctly and all backup features like retention
are applied.
# get created through the Home Assistant Core API (categorized correctly).
# Ultimately this should be handled by Home Assistant Core itself through
# the update entity.
entity_id = f"update.{slugify.slugify(addon.name, separator='_')}_update"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks if users rename the add-on update entities.

To me, it seems rather brittle to call Core here.

What I'd suggest is to extend the SupervisorAddonUpdateEntity class in Core instead. We are missing the breaking version info currently, but that can be added. Since we ultimately like to have auto-updating entities on Core end this seems like the right direction to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant