Add debug logging for fitnessage API response
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -328,11 +328,13 @@ def sync_wellness(garmin, user_id: int, since: Optional[datetime], db,
|
|||||||
# Fetch current VO2 max and fitness age once (slow-changing — only update today's row)
|
# Fetch current VO2 max and fitness age once (slow-changing — only update today's row)
|
||||||
today_str = date.today().isoformat()
|
today_str = date.today().isoformat()
|
||||||
fa_data = _safe(garmin.get_fitnessage_data, today_str)
|
fa_data = _safe(garmin.get_fitnessage_data, today_str)
|
||||||
|
logger.info("fitnessage raw response: %s", fa_data)
|
||||||
if fa_data:
|
if fa_data:
|
||||||
vo2 = (fa_data.get("vo2Max")
|
vo2 = (fa_data.get("vo2Max")
|
||||||
or fa_data.get("vo2MaxPreciseValue")
|
or fa_data.get("vo2MaxPreciseValue")
|
||||||
or fa_data.get("biometricProfile", {}).get("vo2Max"))
|
or fa_data.get("biometricProfile", {}).get("vo2Max"))
|
||||||
fa = fa_data.get("chronologicalAge") or fa_data.get("fitnessAge")
|
fa = fa_data.get("chronologicalAge") or fa_data.get("fitnessAge")
|
||||||
|
logger.info("fitnessage parsed: vo2=%s fa=%s", vo2, fa)
|
||||||
if vo2 and float(vo2) > 0:
|
if vo2 and float(vo2) > 0:
|
||||||
try:
|
try:
|
||||||
fa_row = {"vo2max": float(vo2)}
|
fa_row = {"vo2max": float(vo2)}
|
||||||
|
|||||||
Reference in New Issue
Block a user