Skip to content

Conversation

@jamesarich
Copy link
Collaborator

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.

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 <[email protected]>
@github-actions github-actions bot added the bugfix PR tag label Jan 16, 2026
@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (e470fa8) to head (f92d1e4).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
@jamesarich jamesarich added this pull request to the merge queue Jan 16, 2026
Merged via the queue into main with commit 75a3f89 Jan 16, 2026
6 checks passed
@jamesarich jamesarich deleted the fix/ota-targets branch January 16, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants