-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
Description
The current training status implementation only supports single-device scenarios. The code assumes the first device in the API response and ignores additional devices.
Current Limitation
In the _parse_response
methods for training status classes, we use:
# Get the first device's data (assumes single device for now)
for device_data in report_data.values():
# Process only the first device and return
return [device_data] if isinstance(device_data, dict) else result
Proposed Enhancement
Add support for multiple devices by:
- Processing all devices in the API response instead of just the first one
- Adding device identification to the returned data structures
- Updating the data model to include device-specific information
- Maintaining backward compatibility with existing single-device usage
Implementation Ideas
- Add a
device_id
field to clearly identify which device each training status entry belongs to - Modify
_parse_response
to iterate through all devices inreportData
- Consider adding a class method like
list_by_device()
for device-specific queries - Update tests to cover multi-device scenarios
Files Affected
src/garth/stats/training_status/daily.py
src/garth/stats/training_status/weekly.py
src/garth/stats/training_status/monthly.py
tests/stats/test_training_status.py
Priority
Low - Current single-device support covers most use cases, but this would be valuable for users with multiple Garmin devices.
Metadata
Metadata
Assignees
Labels
No labels