Skip to content

Commit

Permalink
Update ToothbrushingDailyMinutesHealthKitMetric.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
krugerk authored Dec 21, 2024
1 parent 4eea411 commit ad76d3b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,18 @@ class ToothbrushingDailyMinutesHealthKitMetric: CategoryHealthKitMetric {
databaseString: healthkitMetric,
category: HealthKitCategory.SelfCare)
}

override func valueInAppropriateUnits(rawValue: Double) -> Double {
// raw seconds into minutes
rawValue / 60
}

override func recentDataPoints(days: Int, deadline: Int, healthStore: HKHealthStore) async throws -> [any BeeDataPoint] {
try await super.recentDataPoints(days: days, deadline: deadline, healthStore: healthStore)
.map {
NewDataPoint(requestid: $0.requestid,
daystamp: $0.daystamp,
value: NSNumber(value: $0.value.doubleValue / 60),
value: $0.value,
comment: "Auto-entered via Apple Health (\(Self.healthkitMetric))")
}
}
Expand Down

0 comments on commit ad76d3b

Please sign in to comment.