Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dana option to built-in pump simulator #329

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

marionbarker
Copy link
Contributor

This adds Dana as an option for the pump simulator for the Trio app.

Problem with this PR

This may be an existing Trio issue that is revealed by this PR.

I set Max Bolus and Max Basal to the allowed values for Dana (80U and 35 U/hr) and that was accepted when the in-app simulator was accepted.

Omnipod Accepted same limits

When I deleted the simulator and added Omnipod DASH, the Max Bolus/Basal values remained too big for Omnipod.

There should be some range checking when Omnipod is paired - the values are not saved to the pods because pods have no such concept, but the limits should be respected.

Medtronic works as expected

I then attempted to pair a Medtronic and got - max settings exceeded.
After changing the max values to 2 and 2 and pairing pump

  • attempted maxBolus of 35 (this pump allows up to 25).
  • No error message is presented to the user, but the value reverted to the original 2U that was there before.
  • Seems like the error shown in the Xcode log should get picked up and reported:
2024-06-20 14:06:17.349292-0700 FreeAPS[14404:7137695] [MinimedPumpManager] Save delivery limit settings failed: command(MinimedKit.PumpOpsError.pumpError(Max setting exceeded))
  • same comment for maxBasal - I attempted 35, which was accepted by this pump and then 70. The attempt at 70 was restored on the display to 35 (no error was reported - same message as above).

Tagging @avouspierre and @bastiaanv for review.

pr-support_dana_simulator

Copy link
Contributor

@bastiaanv bastiaanv left a comment

Choose a reason for hiding this comment

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

LGTM!

@marionbarker
Copy link
Contributor Author

Status

Confirmed Omnipods have appropriate behavior
Change from draft to final, ready for approvals.

  • Note - with this change the maxBolus and maxBasal can exceed Pod capabilities, but pumpManager limits requests to allowed values.
  • It would be better to limit these values to the pump values but that is outside the scope of this PR

Details

I returned to test this with an Omnipod rPi DASH pod.
Set pump limits to DanaKit max:

  • maxBasal = 35 U/hr
  • maxBolus = 80 U

Attempt to set Omnipod basal rate to 35 U/hr.

  • pump manager only goes up to 30 U/hr

Attempt to bolus 35 U:

  • It silently limited the bolus to 30 U.
  • Silent because the maxBolus was set higher than pumpManager allows

From rPi:

command; 0x1a; PROGRAM_INSULIN; HEX, 170e9b71101f1a0e494e532e02015a01258002580258170dc0177000030d400000000000008092 
response 0x1d; HEX, 170e9b71140a1d6802092258002f17ff0000 

Parsed HEX command:

  msgType =   0x1a17
  msgMeaning =   SetBolus
  autoBolus =   False
  prompt_bolus_u =   30.0
  nonce =   0x494e532e
  TableNum =   2
  chsum =   346
  hhEntries =   1
  secsX8Left =   9600
  pulsesPerHhr =   600
  pulse0 =   600
  xtype =   23
  xlen =   13
  reminders =   192
  promptTenthPulses =   6000
  promptDelay =   200000
  extendedTenthPulses =   0
  extendedDelay =   0
  mlen =   14
  msg_body =   1a0e494e532e02015a01258002580258170dc0177000030d40000000000000
  seqNum =   4
  rawHex =   170e9b71101f1a0e494e532e02015a01258002580258170dc0177000030d400000000000008092
  CRC =   0x8092

@marionbarker marionbarker marked this pull request as ready for review June 25, 2024 21:27
@Sjoerd-Bo3 Sjoerd-Bo3 changed the base branch from alpha to dev July 2, 2024 13:52
@dnzxy
Copy link
Contributor

dnzxy commented Jul 19, 2024

What’s the status on this PR?

@bastiaanv
Copy link
Contributor

It is ready to be merged

@Sjoerd-Bo3
Copy link
Contributor

LGTM

@Sjoerd-Bo3 Sjoerd-Bo3 merged commit 207dd17 into nightscout:dev Jul 26, 2024
mountrcg pushed a commit to mountrcg/Trio that referenced this pull request Jul 26, 2024
…lator

Add Dana option to built-in pump simulator
@MikePlante1 MikePlante1 mentioned this pull request Jul 27, 2024
mountrcg pushed a commit to mountrcg/Trio that referenced this pull request Aug 1, 2024
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.

4 participants