mirror of
https://github.com/usetrmnl/trmnl-android.git
synced 2026-04-29 13:35:26 -07:00
Replace complex user-level battery reporting (PATCH /api/devices/{id}) with
simplified device-level Percent-Charged header sent with image fetch requests.
Changes:
- Add percentCharged parameter to TrmnlApiService.getNextDisplayData()
- Update TrmnlDisplayRepository to send battery for BYOD devices only
- Deprecate reportDeviceBatteryStatus() and getDeviceIdFromApi() methods
- Remove battery reporting call from TrmnlImageRefreshWorker
- Disable user API token UI in AppSettingsScreen (100+ lines)
- Deprecate TrmnlUserApiService and TrmnlDeviceUpdateRequest
- Deprecate userApiToken and deviceId in TrmnlDeviceConfig
- Deprecate DataStore methods for user token and device ID
- Add 4 new battery percentage header tests
- Ignore 6 deprecated battery/device ID tests
- Update existing RSSI tests to include percentCharged parameter
Benefits:
- Simpler: No separate API call needed
- Secure: Uses device-level auth only (no user token required)
- Consistent: Follows same pattern as RSSI header
- BYOD-only: Battery reporting limited to BYOD devices as designed
All changes maintain backward compatibility with deprecated code preserved.
Verified with:
- formatKotlin: ✅ (0 errors)
- lintKotlin: ✅ (0 errors)
- testDebugUnitTest: ✅ (203 passed, 9 skipped)
- assembleDebug: ✅ (APK built successfully)
Project Resources
Contains all the resources for this Android project.
Useful Links
- Material Icons - https://fonts.google.com/icons
- SVG Icons - https://www.svgrepo.com/ or https://www.flaticon.com/
- App Icon Generator - https://icon.kitchen/
- Material Theme Builder - https://material-foundation.github.io/material-theme-builder/
- Device Frame Generator - https://developer.android.com/distribute/marketing-tools/device-art-generator