return suspend when pod fault is detected#15
Conversation
|
I'd suggest changing the comment on line 52 to something like "a faulted pod is always suspended", but otherwise LGTM |
|
In response to the comment request from @itsmojo, I reorganized the code in addition to updating comments.
I believe this version is easier to understand. |
TestFor each test below, copy the full hex string returned by the rPi and then indicate key features in that string using the The only test that failed is one that also failed for the Test: Pod Diagnostics, Read Pod Status - returns 0x0202 responseNominal Scheduled Basal✅ nominal state - scheduled basal Nominal Scheduled Basal with Bolus in progress✅ nominal state - scheduled basal and bolus in progress Nominal Temporary Basal✅ nominal state - temporary basal Nominal Temporary Basal with Reservoir < 50 UNote - after artificially updating reservoir with the front end repeat this test using main branch - it appears this is an existing flaw in the simulator code. ❌ nominal state - temporary basal - expect pod progress of 9 Test: Pod Fault✅ fault - scheduled basal and bolus in progress at time of fault |
UpdateThe most recent commit updates the state value for PodProgress when reservoir is <= 1000 pulses (50 U). TestRepeat the tests with reservoir going from 51 to 50 U and below.
Test: Pod Diagnostics, Read Pod Status - returns 0x0202 responseNominal Temporary Basal with Reservoir < 50 U✅ nominal state - temporary basal - expect pod progress of 9 hx='174681c30018021602090200000a005400000003e6000b000000000000000000' Test: Pod FaultIssue pod fault while bolus is in progressStart a 2 U bolus, Issue out of insulin fault during the bolus |
Purpose
Make the rPi DASH simulator more realistic.
Method
pkg/response/detailedstatusresponse.gowhen fault is detected.pkg/response/detailedstatusresponse.gofor claritypkg/pod/pod.goPodProgress value based on Reservoir valueTest
Before this modification, whatever delivery state the rPi was in was left unchanged when pod fault was detected.
With this modification, the delivery state is suspended:
The Loop app properly indicates the pod as suspended at the time the pod fault is detected (although this does not show up in the Event History until after the pod is deactivated).