Skip to content

Commit ad76d3b

Browse files
authored
Update ToothbrushingDailyMinutesHealthKitMetric.swift
1 parent 4eea411 commit ad76d3b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

BeeKit/HeathKit/Toothbrushing/ToothbrushingDailyMinutesHealthKitMetric.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,18 @@ class ToothbrushingDailyMinutesHealthKitMetric: CategoryHealthKitMetric {
2323
databaseString: healthkitMetric,
2424
category: HealthKitCategory.SelfCare)
2525
}
26+
27+
override func valueInAppropriateUnits(rawValue: Double) -> Double {
28+
// raw seconds into minutes
29+
rawValue / 60
30+
}
2631

2732
override func recentDataPoints(days: Int, deadline: Int, healthStore: HKHealthStore) async throws -> [any BeeDataPoint] {
2833
try await super.recentDataPoints(days: days, deadline: deadline, healthStore: healthStore)
2934
.map {
3035
NewDataPoint(requestid: $0.requestid,
3136
daystamp: $0.daystamp,
32-
value: NSNumber(value: $0.value.doubleValue / 60),
37+
value: $0.value,
3338
comment: "Auto-entered via Apple Health (\(Self.healthkitMetric))")
3439
}
3540
}

0 commit comments

Comments
 (0)