-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Adding expiry warnings to Medtrum Nano pump view #4373
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
base: dev
Are you sure you want to change the base?
Conversation
|
Use themed colors: AndroidAPS/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/ComboV2Fragment.kt Line 121 in faa4c91
That way you can get rid of the green and it will work among all themes See also: |
|
Additional remark: This would need adding context and assuming this would have non-trivial impact on driver implementation. So proposing to solve this first, preferably in a separate PR with proper testing? |
|
Hum, BTW It's understandable if the user decide to keep pump expiry (72h / 6h) within Medtrum driver, but define other thresholds (with longer duration) within overview preferences
Maybe a topic to be discussed... |
|
TODO also: optimize code for readability/dev: function is getting too large... |
|
@Philoul @jbr7rr Added new commits.
Regarding themed colors: Current commit solves by: |
|
@MilosKozak Regarding themed coloring and gac() |
|
Is this really necessary??? |
|
@vanelsberg , following our discussion today, I made some search on MVVM architecture, and here the wording is important...
If I map this mindset within our architecture, most plugins have currently only 2 layers:
We will have to think differently if we want to go in this new architecture... Standard flow of information for presentation is Model (plugin side for data) -> ViewModel (new layer for states) -> View (fragment to show information) Then when user do something (click, write, select) the flow is opposite It starts from View (Listeners, get text...) -> ViewModel (UI logic, states, interaction) -> Model (manage impact on data or business treatment) within plugin...
These explains are for me pure theoretical and I'm not skilled enough to analyze your proposal, so feel free to correct me (I'm learning here 🤓...) |
Can follow you line of reasoning and mostly agree with it. Not een expert on the subject but I think current Medtrum plugin implementation uses what looks like MVC. Other plugins seem to use MVVM where the ViewModel exposes data to the View through binding? Plugin has Model/View in line with the way I see the basics:
With MVC Model and View are strictly separated which in my opinion is the case. So, in the above (our case) Model is presenting the themed string data for updating the view. Data source in this case is the Pump object, which with my change now includes themed state color definitions because in current implementation Model cannot (gac() needs View context which is not available to the Model) . May be there is a better way (as other plugins are designed in a way where view context is available in Model through binding). But afaics this would need a redesign of the current pump plugin (?) which is not something I can do. |
dcdadd9 to
0493ce5
Compare
|
Force-pushed into one single commit |
|
What about the new FW that limits pod life to 5 days ? After 5 days, only basal is given. No alert or message seems to explain what is happening. How to treat those cases ? |
Sure. Once it is clear what limits on what FW versions are active, based on this PR I can add warnings relatively easy. Pump driver itself then also needs some additions were disabling current pump expiry is overruled. Can be the subject of a separate PR. (I think @jbr7rr and others are currently looking into this?) (Btw: I like to keep PR's as clear as possible, targeting a single goal. So, not holding of. I'd be happy to support @jbr7rr in this or taking this in a new PR) |
|
@jbr7rr @Philoul @robertrub @swissalpine |
|
Built now, will test this afternoon |
|
Testing this PR:
Remark: While testing I found that updating AAPS sometimes did not forced MT driver to fully initialize. When no themed coloring, try restarting/exit AAPS. |
Warning colors are according to status lights in AAPS overview? Warning for disabling expiry is in on feedback from Medtrum. This imho is also a safety concern, making sure user is knowingly extending pump from the default and recommended 3 days. |
2e4215f to
94e7cc5
Compare
|
|
PR/Commit#94e7cc57 |
|
|
Feedback: removed warning triangle, color only for patch expiry field. |
pump/medtrum/src/main/kotlin/app/aaps/pump/medtrum/ui/viewmodel/MedtrumOverviewViewModel.kt
Show resolved
Hide resolved
swissalpine
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything works technically as expected. Therefore: No objections!
In terms of content, I still cannot agree with the necessity that the removal of the time limit must and should be marked as a warning (at least the exclamation mark is gone: THANK YOU!). However, I think it's good that the activation time changes color after three days.
|
Have been running this PR with latest dev's for the past 4 weeks and did not find any issues. |




Medtrum Nano pump: Alert user on patch expiry
Context:
By factory default, the Medtrum system expires a Nano Patch after 72 hours. The AndroidAPS pump driver includes an option to disable patch expiry, allowing the patch to be used beyond 72 hours.
Options were discussed to remind the user that:
This PR implements: