refactor(health): remove HRV field and improve notification types
- Remove heart rate variability (hrv) field from health data interfaces and implementations - Update default member name to Chinese localization - Replace type assertions with proper enum types in notification schedulers
This commit is contained in:
@@ -207,7 +207,6 @@ export type HourlyStandData = {
|
||||
|
||||
export type TodayHealthData = {
|
||||
activeEnergyBurned: number; // kilocalories
|
||||
hrv: number | null; // 心率变异性 (ms)
|
||||
// 健身圆环数据
|
||||
activeCalories: number;
|
||||
activeCaloriesGoal: number;
|
||||
@@ -607,7 +606,6 @@ export async function fetchMaximumHeartRate(_options: HealthDataOptions): Promis
|
||||
function getDefaultHealthData(): TodayHealthData {
|
||||
return {
|
||||
activeEnergyBurned: 0,
|
||||
hrv: null,
|
||||
activeCalories: 0,
|
||||
activeCaloriesGoal: 350,
|
||||
exerciseMinutes: 0,
|
||||
@@ -628,19 +626,16 @@ export async function fetchHealthDataForDate(date: Date): Promise<TodayHealthDat
|
||||
// 并行获取所有健康数据
|
||||
const [
|
||||
activeEnergyBurned,
|
||||
hrv,
|
||||
activitySummary,
|
||||
heartRate
|
||||
] = await Promise.all([
|
||||
fetchActiveEnergyBurned(options),
|
||||
fetchHeartRateVariability(options),
|
||||
fetchActivitySummary(options),
|
||||
fetchHeartRate(options)
|
||||
]);
|
||||
|
||||
return {
|
||||
activeEnergyBurned,
|
||||
hrv,
|
||||
activeCalories: Math.round(activitySummary?.activeEnergyBurned || 0),
|
||||
activeCaloriesGoal: Math.round(activitySummary?.activeEnergyBurnedGoal || 350),
|
||||
exerciseMinutes: Math.round(activitySummary?.appleExerciseTime || 0),
|
||||
|
||||
Reference in New Issue
Block a user