Skip to content

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

Open
bjorkert wants to merge 2 commits into
devfrom
feature/end-alarm-early-warning
Open

Add an early warning option to the temp target and override end alarms#721
bjorkert wants to merge 2 commits into
devfrom
feature/end-alarm-early-warning

Conversation

@bjorkert

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.

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

…y-warning

# Conflicts:
#	LoopFollow/Controllers/Nightscout/Treatments/Overrides.swift
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.

1 participant