Name the firmware status column and show the available version - #85
Merged
Conversation
The dashboard status column reports firmware state but was labelled "Status", and its badges leaked raw enum values (update_available, no_update_needed) with no hint of which version an update would install. Both scan paths already know the answer at scan time and discarded it: the device's own Shelly.CheckForUpdate result carries the version, and the manager-side settling pass holds the full index release. Capture it as DiscoveredDevice.available_firmware_version, include it in the /scan response, and render "Update Available (x.y)" in the badge, with readable labels for the other statuses. The version is assigned before the status flips to UPDATE_AVAILABLE so a malformed version string from a device leaves it DETECTED instead of half-updated.
4 tasks
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.
Purpose
Fixes #80. Rename the dashboard "Status" column to "Firmware Status", replace raw badge values with readable labels ("Up to Date", "Auth Required"), and show which version an update would install: "Update Available (2.0)".
Context
Both scan paths already knew the available version and discarded it: the device's own
Shelly.CheckForUpdateresult carries it, and the manager-side settling pass from #84 holds the full index release. It is now captured asDiscoveredDevice.available_firmware_version, returned by/scan, and rendered in the badge.The status column filters and sorts on the displayed label (via
accessorFn), so searching "Update Available" or a version matches what the table shows.Notes
UPDATE_AVAILABLE, so a malformed version string from a device leaves itDETECTEDinstead of half-updated.