Skip to content

Turning off the prediction graph silently disables the predictive low alarm (Loop only) #731

Description

@JustMaier

On the Loop path the predictive low alarm reads the same array the chart draws, so a display setting switches a safety alarm off with no indication in the alarm UI.

AlarmTask.alarmPredictionData() returns predictionData when the device is Loop. That array is only populated in DeviceStatusLoop behind Storage.shared.downloadPrediction.value, and its length is predictionToLoad * 12, both of which live under Graph Settings. So:

  • turning off prediction download leaves the array empty, and LowBGCondition skips the whole predictive branch on its !isEmpty guard, so the alarm silently degrades to a plain low alarm
  • setting Hours of Prediction below 1 shortens the alarm's look-ahead below whatever the user picked in the alarm editor, again with no indication

Neither is visible from the alarm screen, which still shows the predictive minutes the user chose.

The Trio and OpenAPS path is not affected. DeviceStatusOpenAPS keeps the full predBGs arrays and only uses predictionToLoad to bound a min and max scan, so the alarm gets its own series independent of the graph settings.

Fixing it properly probably means the alarm keeping its own copy of the Loop forecast rather than borrowing the chart's, the way the OpenAPS path already does. Happy to put a PR together if that sounds like the right shape.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions