cyberjunky / python-garminconnect

Python 3 API wrapper for Garmin Connect to get activity statistics
MIT License
966 stars 151 forks source link

Training Readiness #92

Closed dpupkov closed 2 years ago

dpupkov commented 2 years ago

Can you please add Training Readiness point? This has been added in most modern watches like Fenix 7 / 955 / etc. Here is point - https://connect.garmin.com/metrics-service/metrics/trainingreadiness/2022-10-03

Reply example:

[{"userProfilePK":4118282,"calendarDate":"2022-10-03","timestamp":"2022-10-02T21:21:38.0","timestampLocal":"2022-10-03T08:21:38.0","deviceId":3421816515,"level":"HIGH","feedbackLong":"HIGH_RT_AVAILABLE_SS_HIGHEST_SLEEP_HISTORY_POS","feedbackShort":"ENERGIZED_BY_GOOD_SLEEP","score":82,"sleepScore":84,"sleepScoreFactorPercent":78,"sleepScoreFactorFeedback":"GOOD","recoveryTime":1055,"recoveryTimeFactorPercent":70,"recoveryTimeFactorFeedback":"GOOD","acwrFactorPercent":95,"acwrFactorFeedback":"GOOD","acuteLoad":569,"stressHistoryFactorPercent":83,"stressHistoryFactorFeedback":"GOOD","hrvFactorPercent":96,"hrvFactorFeedback":"GOOD","hrvWeeklyAverage":55,"sleepHistoryFactorPercent":91,"sleepHistoryFactorFeedback":"VERY_GOOD","validSleep":true,"inputContext":null}]

cyberjunky commented 2 years ago

I have implemented the call in Release 0.1.46, it returns no data for my account, can you test? Thanks!

dpupkov commented 2 years ago

That's working fine. Thanks a lot!

client.get_training_readiness(today.isoformat())

[{'userProfilePK': xxxxxxx,
  'calendarDate': '2022-10-22',
  'timestamp': '2022-10-21T21:36:17.0',
  'timestampLocal': '2022-10-22T08:36:17.0',
  'deviceId': 3421816515,
  'level': 'HIGH',
  'feedbackLong': 'HIGH_RT_AVAILABLE_SS_HIGHEST',
  'feedbackShort': 'RESTED_AND_READY',
  'score': 92,
  'sleepScore': 95,
  'sleepScoreFactorPercent': 95,
  'sleepScoreFactorFeedback': 'VERY_GOOD',
  'recoveryTime': 0,
  'recoveryTimeFactorPercent': 100,
  'recoveryTimeFactorFeedback': 'VERY_GOOD',
  'acwrFactorPercent': 100,
  'acwrFactorFeedback': 'VERY_GOOD',
  'acuteLoad': 352,
  'stressHistoryFactorPercent': 80,
  'stressHistoryFactorFeedback': 'GOOD',
  'hrvFactorPercent': 100,
  'hrvFactorFeedback': 'VERY_GOOD',
  'hrvWeeklyAverage': 54,
  'sleepHistoryFactorPercent': 75,
  'sleepHistoryFactorFeedback': 'GOOD',
  'validSleep': True,
  'inputContext': None}]