Conversation
Notify when a future-dated carb entry's scheduled time arrives, serving as a reminder to start eating in pre-bolus scenarios. Tracks future carb entries across alarm ticks using persistent storage, with configurable max lookahead window (default 45 min) to filter out fat/protein entries and minimum carb threshold (default 5g).
10 test cases covering tracking, firing, deletion, lookahead bounds, min grams filter, past carbs, stale cleanup, multi-carb per-tick behavior, and duplicate prevention. Also fix Tests target missing FRAMEWORK_SEARCH_PATHS for CocoaPods dependencies and add missing latestPumpBattery field in withBattery test helper.
Trio sets created_at to the scheduled future time, but the Nightscout query had an upper bound of "now", excluding any future-dated entries. Extend the query window by predictionToLoad minutes so treatments within the graph lookahead are fetched. Also add addingMinutes parameter to getDateTimeString for precise minute-level offsets.
Replace the prediction-based lookahead with a fixed 6-hour window and rename currentTimeString to endTimeString for clarity.
Collaborator
TestI did a quick test and it worked. I have not had time for code review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FutureCarbsConditioncovering tracking, firing, deletion, lookahead bounds, min grams, stale cleanup, multi-carb behavior, and duplicate prevention