Add debug logging for body battery API response
All checks were successful
Deploy / deploy (push) Successful in 2m28s
All checks were successful
Deploy / deploy (push) Successful in 2m28s
Need to inspect the raw response structure to debug why current and yesterdayLow values are missing despite hasCurrentData=true. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -142,6 +142,12 @@ export async function fetchBodyBattery(
|
|||||||
bodyBatteryValuesArray?: Array<[number, string, number, number]>;
|
bodyBatteryValuesArray?: Array<[number, string, number, number]>;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
// Debug: log the raw response structure
|
||||||
|
logger.info(
|
||||||
|
{ rawData: JSON.stringify(data).slice(0, 2000), date, yesterday },
|
||||||
|
"Body battery raw API response",
|
||||||
|
);
|
||||||
|
|
||||||
// Find today's and yesterday's data from the response array
|
// Find today's and yesterday's data from the response array
|
||||||
const todayData = data?.find((d) => d.date === date);
|
const todayData = data?.find((d) => d.date === date);
|
||||||
const yesterdayData = data?.find((d) => d.date === yesterday);
|
const yesterdayData = data?.find((d) => d.date === yesterday);
|
||||||
|
|||||||
Reference in New Issue
Block a user