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

Display Pump Status Highlight Message in home view #218

Merged
merged 3 commits into from
May 23, 2024

Conversation

avouspierre
Copy link
Contributor

Display the eventual Pump Statut Highlight Message in home view if state is warning or critical.

fix partially issue #207 with displaying "No pod" in the homeview.

Example in French :

Warning message Critical message
CleanShot 2024-05-19 at 09 44 58@2x CleanShot 2024-05-19 at 09 44 27@2x

Display the eventual Pump Statut Highlight Message in home view if state is warning or critical.

fix partially issue nightscout#207
@bjornoleh
Copy link
Contributor

I suppose Statut is a typo and should be replaced with Status in English?

@marionbarker
Copy link
Contributor

I agree with @bjornoleh. The variable and function names should use Status: pumpStatutHighlightMessage and displayPumpStatutHighlightMessage.

Start by testing what is there (or not there) in dev, commit 5e51344.
Note - the expiration count-down issue seems to be present in dev and not caused or addressed by this PR.

Test without the patch with pods using an rPi DASH simulator.

  • Deactivate pod: no message shown
  • Reservoir notification set to 10 U; use front end to set reservoir level to 5 U
    • The drop next to reservoir level on main screen is red (instead of blue)
  • Trigger Fault on pod - shows up on pod screen but not on main screen
  • Pod age notification set to 70 hours, set rPi pod age to 71 hours
    • Green dot on main screen changes to red stop-watch starts count-down from 59 minutes

Test after applying the patch with pods using an rPi DASH simulator.

  • unchanged: indication when pod age exceeds notification, by now says 45 m
  • unchanged: indication when reservoir is below notification level
  • increase pod age to 4602 minutes (76.7 hours), main screen did not update, it keeps counting down a minute at a time and now says 38 m

These next things are new and a success:

  • Trigger fault on pod (0x12) - error message appears, dismiss message - takes me to Omnipod screen (excellent)
    • main screen shows red "!! Pod Error"
  • Deactivate pod: main screen show "warning: No Pod"
  • Pair pod: quit and restart app:
    • main screen shows finish setup
    • begin insertion; quit and restart app:
    • main screen shows finish setup
  • Trigger out of insulin "fault", error message, dismiss message - takes me to pod screen, main screen shows red "!! No Insulin"
  • Repeat for 80 hour, same behavior, main screen shows red "!! Pod Expired"

Yet to do: Medtronic pod testing. So far so good.

@avouspierre avouspierre changed the title Display Pump Statut Highlight Message in home view Display Pump Status Highlight Message in home view May 19, 2024
@avouspierre
Copy link
Contributor Author

@marionbarker - I tried to analyse some test results with my rPi simulator :

  • unchanged: indication when pod age exceeds notification, by now says 45 m :

Seems a correct behavior.

  • unchanged: indication when reservoir is below notification level

Seems a correct behavior. When reservoir = 0 ➡️ message "No insulin" and error alert.

  • increase pod age to 4602 minutes (76.7 hours), main screen did not update, it keeps counting down a minute at a time and now says 38 m

Seems correct because a alert (Exceeded maximum Pod of Life...) is provided by pump when pod age > max ➡️ message "Pod expired".

Change statut to status variable and function
@avouspierre
Copy link
Contributor Author

Updated with the correction of statut ➡️ status

Copy link
Contributor

@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.

Just a minor change in a comment.

FreeAPS/Sources/Modules/Home/HomeStateModel.swift Outdated Show resolved Hide resolved
@marionbarker
Copy link
Contributor

My prior test was not valid.
A real pod has an alert set when it has a notification or if it expires.
(My apologies - I often forget that I need to set the alert as well as the time to get reasonable responses with the rPi DASH simulator.)

I repeated the test for what happens near the time the pod reaches expiration.

  • Set the pod active time to 4315 minutes (72 hours minus 5 minutes)
  • Observe the main screen as the time counts down

Stages:

  • main display: red Stop Watch: 4 m
  • observe main screen at 0 m
  • observe main screen with red Stop Watch: Replace pod icon

@marionbarker marionbarker self-requested a review May 20, 2024 16:37
marionbarker
marionbarker previously approved these changes May 20, 2024
Copy link
Contributor

@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.

I tested for Pods and approve this PR based on those tests.
For the second review, it should probably be tested with Medtronic.

@MikePlante1
Copy link
Contributor

MikePlante1 commented May 22, 2024

GitHub/Xcode problems slowed me down a bunch, so I'll have to continue this tomorrow.

From my initial test:
Fresh install to iPhone SE (2nd gen) iOS 16.2
"Add Pump" icon
Added Medtronic 722 pump + OrangeLink
icon changed to "!! Signal Loss" (much better than staying at "add pump" icon like before)
Added cgm (glucose simulator) and icon changed to typical Medtronic status icons

Copy link
Contributor

@itsmojo itsmojo left a comment

Choose a reason for hiding this comment

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

Using the pumpManager's pumpStatusHighlightMessage for the HUD is
corrects a long standing shortcoming in iAPS. The code LGTM, but I haven't tried it out myself. I can't particularly say that I particularly love the new look though, hopefully it'll grow on me... ;-)

@MikePlante1
Copy link
Contributor

Okay, I finished some more tests with my Medtronic 722.

It shows ⚠️Insulin Suspended when the pump is suspended from the pump module in Trio, when the pump is suspended from the physical pump's menu, and when the pump completely runs out of insulin (actually runs out, not just says 0U)

The typical Medtronic status icons (battery and reservoir) are displayed at all other times, including when the pump claims 0U but actually still has insulin left, when the pump is out of range of the OrangeLink, and when the OrangeLink is out of range of the phone.

MikePlante1
MikePlante1 previously approved these changes May 22, 2024
Copy link
Contributor

@MikePlante1 MikePlante1 left a comment

Choose a reason for hiding this comment

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

Tested with a Medtronic 722 and everything looked good.

@bjornoleh bjornoleh dismissed stale reviews from MikePlante1 and marionbarker via 86cfa27 May 23, 2024 20:40
Copy link
Contributor

@bjornoleh bjornoleh left a comment

Choose a reason for hiding this comment

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

Looks good from testing on a phone.

Tested "No pod" with Dash, and Simulator suspend and occlusion.

Did not review code.

@Sjoerd-Bo3 Sjoerd-Bo3 self-requested a review May 23, 2024 21:41
Copy link
Contributor

@Sjoerd-Bo3 Sjoerd-Bo3 left a comment

Choose a reason for hiding this comment

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

LGTM Tested with Omnipod Dash

@bjornoleh
Copy link
Contributor

Merging with two approvals (several when including those before the last commit with only a trivial change).

@bjornoleh bjornoleh merged commit 5faf162 into nightscout:dev May 23, 2024
1 check passed
@MikePlante1 MikePlante1 mentioned this pull request May 27, 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.

6 participants