Skip to content

Add an early warning option to the temp target and override end alarms - #721

Merged
marionbarker merged 5 commits into
devfrom
feature/end-alarm-early-warning
Oct 26, 2026
Merged

marionbarker merged 5 commits into
devfrom
feature/end-alarm-early-warning

Conversation

@bjorkert

@bjorkert bjorkert commented Jul 23, 2026 •

Copy link
Copy Markdown
Member

This adds an Early Warning setting to the Temp Target Ended and Override Ended alarms. It can be set from 0 to 30 minutes in steps of 5 and defaults to 0, which keeps the current behavior. With a lead time set, the alarm fires that many minutes before the scheduled end with the title Temp Target Ending Soon or Override Ending Soon, and then fires again as usual when it actually ends. Each firing happens at most once per event, and extending an active temp target or override arms a new warning for the new end time.

Overrides now carry their unclamped scheduled end next to the graph end date, which is capped to the display horizon. Indefinite Loop overrides have no known end and never trigger the early warning. The full screen alarm view shows the early warning title too.

Includes unit tests for both alarm conditions.

Screenshots

Early Warning setting Early warning firing
early-warning-setting ending-soon-alarm

The end alarms can now also fire a chosen number of minutes before the
scheduled end, titled Temp Target Ending Soon or Override Ending Soon,
and still fire normally when the event actually ends. Default is 0 which
keeps the current behavior. Overrides keep their unclamped scheduled end
so indefinite or long overrides do not warn incorrectly. Includes unit
tests for both conditions.
@bjorkert

Copy link
Copy Markdown
Member Author
image

bjorkert added 4 commits July 24, 2026 20:00
…y-warning

# Conflicts:
#	LoopFollow/Controllers/Nightscout/Treatments/Overrides.swift
…y-warning

# Conflicts:
#	Tests/AlarmConditions/Helpers.swift
…y-warning

# Conflicts:
#	LoopFollow/Alarm/Alarm.swift
#	LoopFollow/Controllers/Nightscout/Treatments/Overrides.swift
#	LoopFollow/Helpers/DataStructs.swift

@marionbarker marionbarker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve by test.

@marionbarker
marionbarker merged commit 3bf62fc into dev Oct 26, 2026
1 check passed
@marionbarker
marionbarker deleted the feature/end-alarm-early-warning branch October 26, 2026 23:29
snickerdoodleparent pushed a commit to snickerdoodle-co/LoopFollow that referenced this pull request Nov 4, 2026
Brings in the Apple Watch app (loopandlearn#785), the end alarms' early warning (loopandlearn#721), the home
screen TIR band with its shared period (loopandlearn#774), the range thresholds in one place with
Extended Tight Range / TING 63–140 mg/dL (loopandlearn#791), the DST fix for the stats day loops
(loopandlearn#795) and the fixes for explicit-null Nightscout fields (loopandlearn#797).

Kept from this branch: the dynamic glucose colors (TIR band, graph, Live Activity) with
the Target setting, the Weekend Profile overrides and remote commands, the BFU check
before alarms, the TIR band shown by default.

The older watch app (LoopFollowWatch Watch App, the phone's WatchComplication and
WatchConnectivityManager) gives way to loopandlearn#785's. The Weekend Profile commands use
ReturnNotificationInfo.loopFollow(), as loopandlearn#785 moved the helper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UUzqfqfsM8BQYJ2yoRaLz8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants