-
-
Notifications
You must be signed in to change notification settings - Fork 193
fix: report installed_version and available_version states in OTA page instead of build id and date #2470
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
Conversation
…e instead of build id and date
I don't think that's the expected formatting.
They are just taking the plain hex and splitting it to make a version out of it. const versionString = version.toString(16).padStart(8, "0");
const appRelease = `${versionString[0]}.${versionString[1]}`;
const appBuild = versionString.slice(2, 4);
const stackRelease = `${versionString[4]}.${versionString[5]}`;
const stackBuild = versionString.slice(6); |
I see, yes I started with plain hex formatting as defined by the specs but then I have switched to dec for my aesthetic sense, my bad, I should have stick with the specs. Will fix it. |
Ok I think I've got it right this time. If you like it I will commit the change, otherwise I'm open to any suggestion 👍 Or maybe another option is to pad each hex to 2 digits so with many devices all the versions will be nicely formatted in a fixed size column: I like more this formatting, to me it is aesthetically more pleasant so if you agree I would commit this one. |
I would say just: |
src/i18n/locales/en.json
Outdated
@@ -2662,7 +2662,7 @@ | |||
"firmware_installed_version": "Firmware installed version", | |||
"firmware_available_version": "Firmware available version", | |||
"firmware_installed_version_na": "Not yet reported by device", | |||
"firmware_available_version_na": "No firmware available", | |||
"firmware_available_version_na": "N/A", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need to use a translation for this one, the rest of frontend doesn't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, fix done.
Thanks! |
This PR fixes the confusion that is caused to the users by displaying manufacturer-specific build-id and build-date in OTA page, which are optional variables and not all manufacturers implement them. This causes those fields in the page to be blank.
I have replaced them with installed_version, as defined by the ZigBee protocol and available_version detected by firmware repository, which are directly related and actually used during an OTA check/update.
See also my conversation with Nerivec in Koenkk/zigbee2mqtt#24051
This PR fixes Koenkk/zigbee2mqtt#24051, Koenkk/zigbee2mqtt#24579, Koenkk/zigbee2mqtt#15839, Koenkk/zigbee2mqtt#25403, Koenkk/zigbee2mqtt#16421, #1860 and possibly others that I couldn't find in the Issues list.
Please, @nurikk, @Nerivec and @Koenkk review and let me know if it's ok or there is something that requires more work.