Skip to content

calculate average using system_time instead of assuming 1 data point every 5m #7

@scottleibrand

Description

@scottleibrand

Starting at https://github.com/openaps/openaps-js/blob/master/bin/determine-basal.js#L8 we determine the average delta over the last 3, 2, or 1 available CGM data points. In cases where CGM data is missing, this results in an overestimate of the (absolute value of the) average delta, which can cause OpenAPS to overreact until it gets more CGM data.

It would be better to calculate the average delta using the elapsed CGM system time between the two data points under comparison, instead of naively assuming each data point represents 5 minutes.

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