nightscout / Trio

MIT License
45 stars 125 forks source link

Add Dana option to built-in pump simulator #329

Open marionbarker opened 1 week ago

marionbarker commented 1 week ago

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

Tagging @avouspierre and @bastiaanv for review.

pr-support_dana_simulator

marionbarker commented 6 days ago

Status

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

Details

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

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

Attempt to bolus 35 U:

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