Skip to content

Commit fd3635e

Browse files
Nutcaseyclaude
andcommitted
Say why only temp basals marked not automatic count as manual
A dose record whose automatic is nil hasn't said whether it was manual. The temp basals Loop works out from reservoir readings are like that, so counting nil as manual would show the loop as open wherever they appear. This matches isManualTempBasalRunning on the home screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnVP76NGVVgM8zLKUCSEG
1 parent 5aefabf commit fd3635e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎Loop/Redesign/LoopHistoryProvider.swift‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ final class LoopHistoryProvider {
305305
func manualTempBasals(in interval: DateInterval) async throws -> [DateInterval] {
306306
// The last run before the period may have stopped for a temp basal that ended before the period too.
307307
// Keep its record so the run-based fallback cannot reopen the loop after that recorded end.
308+
// As on the home screen, only a record that says it isn't automatic counts: one that doesn't say, such as a
309+
// dose worked out from reservoir readings, isn't known to be manual.
308310
try await doseStore.getNormalizedDoseEntries(start: interval.start.addingTimeInterval(-.minutes(15)), end: interval.end)
309311
.filter { $0.type == .tempBasal && $0.automatic == false && $0.endDate > $0.startDate }
310312
.map { DateInterval(start: $0.startDate, end: $0.endDate) }

0 commit comments

Comments
 (0)