Skip to content

Show update release URL for installed version#702

Merged
TheJulianJES merged 5 commits intozigpy:devfrom
TheJulianJES:tjj/update_show_info_downgrades
Mar 24, 2026
Merged

Show update release URL for installed version#702
TheJulianJES merged 5 commits intozigpy:devfrom
TheJulianJES:tjj/update_show_info_downgrades

Conversation

@TheJulianJES
Copy link
Copy Markdown
Contributor

@TheJulianJES TheJulianJES commented Mar 5, 2026

Proposed change

This changes ZHA update entities to show the release_url of the latest firmware (provided as .downgrades[0]).

Additional information

For zigpy-ota provided updates, the release_url is generally a link to the pull request where that update was submitted. The pull request also shows more context for the update, potentially with additional release notes in the comments. This also allows us to have an easy place to collect feedback for these updates and for HA users to find that, even after they already installed the update.

We can also consider showing the latest (markdown) release notes if that update is already installed. If so, should only the latest version's release notes be shown, the last 5, or all of them?

Related:

Newer version installed than latest in OTA repo?

Right now, we'll show the release URL for the latest version in zigpy-ota. If a user has newer firmware installed than in the zigpy-ota repo, should we not show that link then?
This sometimes happens when manufacturers install new firmware in the factory but consider it to be unimportant to upgrade existing devices with.

Apps

ESPHome / HA apps do not use HA's release_url but instead provide the "release announcement link" in the release notes themselves. This may also be useful for us, since we combine multiple upgrade release notes with the PR linked above, but only ever show the link for the latest release.

More info dialog for ESPHome update entity showing release announcement link in the release notes itself, instead of using HA's dedicated release link position at the top

It's also a little easier to spot there IMO, as it's currently a bit hidden at the top. The general update note is only shown below, which Matter might do the other way around even(?)

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.62%. Comparing base (e890251) to head (c482200).
⚠️ Report is 2 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #702   +/-   ##
=======================================
  Coverage   97.62%   97.62%           
=======================================
  Files          62       62           
  Lines       10957    10958    +1     
=======================================
+ Hits        10697    10698    +1     
  Misses        260      260           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TheJulianJES TheJulianJES marked this pull request as ready for review March 24, 2026 06:37
Copilot AI review requested due to automatic review settings March 24, 2026 06:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates ZHA’s update entities to expose a release_url even when no upgrade is available and the latest known firmware is only present in images_result.downgrades (common when the installed firmware is newer than what the OTA provider has indexed).

Changes:

  • Set release_url from event.images_result.downgrades[0].metadata.release_url when only downgrades are returned.
  • Extend the downgrade-only test case to include and assert release_url propagation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
zha/application/platforms/update.py Populate _attr_release_url for the downgrade-only scenario using the latest downgrade’s metadata.
tests/test_update.py Update the downgrade-only test to provide a release_url in the mock image metadata and assert it appears in entity state.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@TheJulianJES
Copy link
Copy Markdown
Contributor Author

IMO, we should just show all old firmware versions with full release notes. That's what all add-ons/apps apparently do.
For now, let's merge this.

@TheJulianJES TheJulianJES merged commit 5848461 into zigpy:dev Mar 24, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants