Commit Graph

20 Commits

Author SHA1 Message Date
Davide Ferrari
84b75d5f87 fix: added clarifications 2025-12-14 19:40:28 +01:00
Davide Ferrari
ceb5ae3cc9 fix: use RFC3339 date format for API date filtering
The TeslamateApi parseDateParam function expects RFC3339 format
with time component (2024-12-07T00:00:00Z), not date-only format.

- Start date: append T00:00:00Z
- End date: append T23:59:59Z
- Pass dates directly to load functions to avoid race conditions
- Remove unused DateTimeFormatter

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 19:36:05 +01:00
Davide Ferrari
b6b6fa889f fix: fetch all charges and drives (API defaults to 100)
- Add page and show query parameters to getCharges and getDrives
- Set show=50000 to fetch all results instead of default 100
- This fixes date filtering and shows correct totals in summary

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 19:17:14 +01:00
Davide Ferrari
86fa2f8807 fix: correct DriveModels JSON structure to match TeslamateApi
- Add DrivesData wrapper class for nested data.drives structure
- Update field names: id -> drive_id, use nested objects
- Add DriveOdometerDetails, DriveBatteryDetails, DriveRange classes
- Add convenience accessors for backward compatibility
- Update repository to extract drives from data.drives

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 19:06:35 +01:00
Davide Ferrari
6d5fb3542a feat: add Drives screen with trip history
- Create DrivesViewModel with date filtering and summary stats
- Create DrivesScreen with card-based layout matching Charges design
- Add drive history with distance, duration, max speed, and battery usage
- Add navigation route and card from Dashboard
- Support date filtering (Last 7/30/90 days, Last year, All time)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 19:01:00 +01:00
Davide Ferrari
b9059dfa5c refactor: remove Climate card (temps now in status bar)
Temperatures are already displayed in the status indicators row,
making the separate Climate card redundant.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 18:49:58 +01:00
Davide Ferrari
2c899299f3 feat: add temperatures to status indicators row
Move state/lock indicators to left, add inside/outside temps on right.
Creates a compact info bar: "Asleep 🔒Locked ... 🌡23° 🌡14°"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 18:47:35 +01:00
Davide Ferrari
dd1530ae8e feat: compact status indicators in dashboard
Replace large State and Locked cards with compact right-aligned
indicators showing icons with small text (e.g., "Asleep", "Locked").
Saves vertical space and improves dashboard density.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 18:41:08 +01:00
Davide Ferrari
b5e4480ee1 feat: add currency selection for charge costs
- Add Currency data class with 38 currencies sorted by global usage
  (based on BIS Triennial Survey and SWIFT data)
- Add currency setting to SettingsDataStore (default: EUR)
- Add currency dropdown in Settings screen under "Display Settings"
- Display selected currency symbol in Charges screen
  (summary cards and individual charge items)
- Update SettingsViewModelTest for new parameter

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 18:28:54 +01:00
Davide Ferrari
0068dfedcf feat: improve Charges screen with card-based layout
Each charge session now displays in a visually distinct group with:
- Header card showing location and date
- 2x2 grid of stat cards for energy, duration, cost, and battery
- Better visual separation matching Dashboard card style

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 18:10:25 +01:00
Davide Ferrari
5e4f44838d fix: use Card onClick parameter for clickable navigation card
Material3 Card requires onClick parameter instead of clickable modifier
for proper touch handling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 15:20:03 +01:00
Davide Ferrari
c55881df01 feat: add date filtering to Charges screen
- Add filter chips for preset date ranges (7/30/90 days, year, all)
- Update summary statistics based on selected period
- Update CHANGELOG

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 15:12:07 +01:00
Davide Ferrari
dfbf2d95d6 feat: add Charges screen with charging history
- Create ChargesScreen with summary statistics and session list
- Add ChargesViewModel for state management
- Update ChargeModels for nested API response structure
- Add ChargeDetailResponse and ChargeDetail models
- Add navigation from Dashboard to Charges screen
- Update CHANGELOG with new feature

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 15:10:17 +01:00
Davide Ferrari
9f2ff03843 test: update DashboardViewModelTest for new API model structure
- Update test data to use nested model classes
- Fix CarData to use 'name' instead of 'displayName'
- Fix CarStatus to use nested BatteryDetails, ChargingDetails, etc.
- Add missing imports for new model classes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 15:03:15 +01:00
Davide Ferrari
3879eefd1e fix: update API models to match actual TeslamateApi response format
The TeslamateApi returns nested JSON structures:
- Cars: data.cars[] instead of data[]
- Status: data.status.{nested objects} instead of flat data

Changes:
- Add CarsData wrapper with cars array
- Add CarStatusData wrapper with status object
- Restructure CarStatus to use nested objects:
  - CarStatusDetails (locked, sentry_mode, etc.)
  - CarGeodata (geofence, latitude, longitude)
  - CarVersions (version, update_available)
  - DrivingDetails (speed, power, heading)
  - ClimateDetails (temps, climate state)
  - BatteryDetails (levels, ranges)
  - ChargingDetails (charging state, power)
- Add convenience getters for backward compatibility
- Update repository to navigate nested responses
- Fix preview composable to use new model structure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 14:59:21 +01:00
Davide Ferrari
a91eb3f6e0 feat: add option to accept self-signed TLS certificates
- Add 'Accept invalid certificates' checkbox in Settings screen
- Show security warning when option is enabled
- Configure OkHttpClient with custom TrustManager for insecure mode
- Detect SSL handshake errors and suggest enabling the option
- Update unit tests for new functionality

This allows connecting to self-hosted TeslamateApi instances that use
self-signed certificates, which is common in home lab environments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 12:27:07 +01:00
Davide Ferrari
2ee3f2a98a test: add unit tests for Settings and Dashboard ViewModels
- Add SettingsViewModelTest with tests for:
  - Initial state loading from DataStore
  - URL and token updates
  - Connection testing (validation and API calls)
  - Settings saving
- Add DashboardViewModelTest with tests for:
  - Car loading and selection
  - Status fetching and refresh
  - Error handling
  - Multiple car support

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 12:12:49 +01:00
Davide Ferrari
dfd98376e9 feat: add Dashboard screen with vehicle status
- Create DashboardScreen with battery, charging, climate, and vehicle info cards
- Add DashboardViewModel with car loading and status fetching
- Implement StartDestinationViewModel for smart navigation
- Add pull-to-refresh functionality
- Display battery level with color-coded status
- Show charging info when plugged in (power, energy, time remaining)
- Display climate temperatures (inside/outside)
- Show vehicle state, lock status, location, odometer, software version
- Auto-navigate to Dashboard if server already configured

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 12:08:14 +01:00
Davide Ferrari
8c5f594cee feat: add TeslamateApi Retrofit client and repository
- Create API models for cars, charges, drives, battery health
- Implement TeslamateApi Retrofit interface with all endpoints
- Add NetworkModule with OkHttp client and auth interceptor
- Create TeslamateRepository with ApiResult sealed class
- Update SettingsViewModel to use real connection test

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 12:06:08 +01:00
Davide Ferrari
d6cb3b42f2 feat: initial project structure with Settings screen
- Set up Kotlin + Jetpack Compose Android project
- Configure Gradle with version catalog and all dependencies
- Implement Settings screen for TeslamateApi server configuration
- Add Material Design 3 theming with Tesla-inspired colors
- Set up Hilt dependency injection
- Add DataStore for settings persistence
- Include navigation component with Compose integration
- Add GPLv3 license

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 12:03:25 +01:00