feat(firmware): Use pio_env to select correct firmware variant#4244
Merged
Conversation
This change improves firmware update reliability by using the `pio_env` value reported by the device to select the correct firmware variant. This is particularly important for devices that have multiple variants (e.g., with different screens or features) that share the same hardware model number. Changes include: - Storing the `pio_env` from `MyNodeInfo` in the database. - Modifying `DeviceHardwareRepository` to accept an optional `target` string to disambiguate between multiple hardware entries sharing the same `hwModel`. - Updating the `DeviceHardware` primary key to `platformio_target` to allow multiple entries per `hwModel`. - Adjusting the firmware retrieval logic to bypass the generic unified OTA binary for devices with specialized UIs (MUI or E-ink) that require specific firmware builds. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4244 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 3 3
Lines 23 23
Branches 7 7
=====================================
Misses 23 23 ☔ View full report in Codecov by Sentry. |
This commit enhances the device details screen to display the PlatformIO target/environment alongside the hardware name (e.g., "T-Beam (tbeam)"). This is achieved by: - Passing the reported `pioEnv` (PlatformIO environment) to the `deviceHardwareRepository` for more accurate hardware lookups. - Storing the `reportedTarget` in the `MetricsState`. - Updating the UI to show the target in parentheses next to the hardware display name. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Improves device hardware identification by adding a fallback mechanism. If a device cannot be found using its `hwModel`, the repository will now attempt to look it up using its `platformioTarget`. This is particularly useful for new or unknown hardware variants where the `hwModel` might be `0` or not yet present in the local database. Changes include: - Adding a `getByTarget` query to the `DeviceHardwareLocalDataSource`. - Updating `DeviceHardwareRepository` to use the target-based lookup as a fallback in multiple scenarios (cache, remote fetch, and bundled JSON). - Adding unit tests to verify the new disambiguation and fallback logic. - Updating `FirmwareRetrieverTest` to correctly handle NRF52 and STM32 variants based on `platformioTarget`. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Updates the file path for the Kover code coverage report in the `reusable-android-test.yml` and `reusable-android-build.yml` GitHub Actions workflows. The path is changed from `build/reports/kover/xml/report.xml` to `build/reports/kover/report.xml`. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
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.
This change improves firmware update reliability by using the
pio_envvalue reported by the device to select the correct firmware variant. This is particularly important for devices that have multiple variants (e.g., with different screens or features) that share the same hardware model number.Changes include:
pio_envfromMyNodeInfoin the database.DeviceHardwareRepositoryto accept an optionaltargetstring to disambiguate between multiple hardware entries sharing the samehwModel.DeviceHardwareprimary key toplatformio_targetto allow multiple entries perhwModel.