Skip to content

Round to supported rate before setting temp basal rate#4

Merged
marionbarker merged 1 commit into
loopandlearn:triofrom
MikePlante1:round-temp-basal
Apr 3, 2025
Merged

Round to supported rate before setting temp basal rate#4
marionbarker merged 1 commit into
loopandlearn:triofrom
MikePlante1:round-temp-basal

Conversation

@MikePlante1
Copy link
Copy Markdown

This PR mirrors LoopKit#16

The issue this addresses would not be noticed with Loop, as Loop rounds before attempting to enact a temporary basal rate. This issue became apparent when using Trio, though, since Trio does not round before attempting to enact a temporary basal rate, leaving the task of rounding up to the pump's submodule. OmniBLE and OmniKit both already internally handle this rounding task, so this PR aims to add it to MinimedKit as well.

I added this commit to my in-vitro build of Trio-dev.

I added a debugging log message in Trio whenever it attempts to enact a temp basal rate that is unsupported by the pump. Before when this was triggered, I would check Trio's History and see two temp basal records for the same time and one of them would be for the unsupported rate. Here's an example of that:

Since adding this commit to my in-vitro Trio build, however, I have had a couple log messages for attempts to enact an unsupported basal rate, but Trio's History only shows the single rounded and supported temp basal rate. Given this, I think this commit solves this issue.

Copy link
Copy Markdown

@marionbarker marionbarker left a comment

Choose a reason for hiding this comment

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

Based on code review and testing found in LoopKit PR 16, I approve this PR.

@marionbarker marionbarker merged commit ecd3588 into loopandlearn:trio Apr 3, 2025
@MikePlante1 MikePlante1 deleted the round-temp-basal branch October 14, 2025 23:32
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