Show update release URL for installed version#702
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
# Conflicts: # zha/application/platforms/update.py
There was a problem hiding this comment.
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_urlfromevent.images_result.downgrades[0].metadata.release_urlwhen only downgrades are returned. - Extend the downgrade-only test case to include and assert
release_urlpropagation.
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.
|
IMO, we should just show all old firmware versions with full release notes. That's what all add-ons/apps apparently do. |
Proposed change
This changes ZHA update entities to show the
release_urlof the latest firmware (provided as.downgrades[0]).Additional information
For zigpy-ota provided updates, the
release_urlis 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_urlbut 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.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(?)