4 Commits
Author SHA1 Message Date
Hossain Khan 0614f59ff9 feat: migrate battery reporting to Percent-Charged header
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)
2026-02-05 19:37:50 -05:00
Hossain Khan b7e517eeb6 docs: Update all URLs from usetrmnl.com to trmnl.com
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-com

Fixes #240
2026-01-31 16:43:41 -05:00
Hossain Khan c4002b37c3 docs: Add README for TRMNL API specification
- Document OpenAPI portal link and API documentation resources
- Explain authentication methods (device-level vs user-level)
- Reference implementation files in the codebase
2026-01-31 08:40:40 -05:00
Hossain Khan 340f3399c9 Refactor: Separate device-level and user-level API services
- Create TrmnlUserApiService for user-level (Bearer auth) endpoints
- Move getDevice() and updateDevice() to TrmnlUserApiService
- Update TrmnlApiService to focus on device-level (Access-Token) endpoints
- Remove device management endpoints from TrmnlApiService
- Add OpenAPI documentation references (https://trmnl.com/api-docs/index.html)
- Clean up imports and improve documentation

This separation clarifies authentication requirements:
- TrmnlApiService: Device API key via Access-Token header
- TrmnlUserApiService: Account API key via Bearer Authorization header
2026-01-31 08:39:24 -05:00