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)
Update base domain from usetrmnl.com to trmnl.com across the entire
codebase including:
- API base URLs (TRMNL_API_SERVER_BASE_URL, TRMNL_SITE_URL)
- Documentation links (docs.usetrmnl.com → docs.trmnl.com)
- Help articles (help.usetrmnl.com → help.trmnl.com)
- Code comments and examples
- Test data
- README and Google Play Store descriptions
This aligns with TRMNL's domain migration as documented in:
https://trmnl.com/blog/trmnl-dot-comFixes#240
- Document OpenAPI portal link and API documentation resources
- Explain authentication methods (device-level vs user-level)
- Reference implementation files in the codebase