Coder Social home page Coder Social logo

trio's People

Contributors

andreasstokholm avatar aug0211 avatar avouspierre avatar bashjs avatar bjorkert avatar bjornoleh avatar brianwieder avatar dnzxy avatar dobbywankenoby avatar dsnallfot avatar itsmojo avatar ivalkou avatar jamiekeene avatar johandegraeve avatar jon-b-m avatar kskandispersonal avatar kylmcw avatar liroyvh avatar marionbarker avatar mikeplante1 avatar mountrcg avatar paulplant avatar polscm32 avatar purplenoodlesoop avatar scrappy avatar sethgagnon avatar sjoerd-bo3 avatar tmhastings avatar trixing avatar zubernuker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trio's Issues

Minor iAPS left-overs

These are nits - just providing this list so they are available for update when and if desired.

I am testing only alpha branch (soon to be dev).
Configuration: commit 99effeb

This is a plist file so a little different:

  • Open-iAPS/FreeAPS/Resources/Info.plist
  • contains <string>com.artificial-pancreas-iaps</string>

The rest of these are in *.swift files and indicate the line numbers where hard-coded "iAPS" exists:

  • FreeAPS/Sources/Shortcuts/State/
    • ListStateIntent.swift, line 6, 12, (not sure about the StateiAPSResults, see next file)
    • StateIntentRequest.swift (I suspect this should be left alone - I do not know what it does)
    • ListStateView.swift (same comment)

Note: many of the rest of these should (later) be modified to use appName instead of hard coded string

  • I did not list all the places with hard-coded Open-iAPS but there are a lot
  • In the short term - simplest solution is to replace the hard-coded "iAPS" with hard-coded "Open-iAPS"
  • Next update, we can modify to using appName instead - that takes more time and effort

Hard-coded string from iAPS to Open-iAPS

  • Open-iAPS/FreeAPS/Sources/Application/FreeAPSApp.swift, line 58
  • Open-iAPS/FreeAPS/Sources/Modules/HealthKit/View/AppleHealthKitRootView.swift line 16
  • Open-iAPS/FreeAPS/Sources/Modules/NightscoutConfig/View/NightscoutConfigRootView.swift lines 106 and 132
  • Open-iAPS/FreeAPS/Sources/Modules/NotificationsConfig/View/NotificationsConfigRootView.swift line 95
  • Open-iAPS/FreeAPS/Sources/Modules/PreferencesEditor/PreferencesEditorStateModel.swift lines 44, 240, 381
  • Open-iAPS/FreeAPS/Sources/Modules/PreferencesEditor/View/PreferencesEditorRootView.swift line 25
  • Open-iAPS/FreeAPS/Sources/Services/WatchManager/GarminManager.swift line 160
  • Open-iAPS/FreeAPS/Sources/Services/Calendar/CalendarManager.swift line 96
  • Open-iAPS/FreeAPSWatch WatchKit Extension/ComplicationController.swift lines 11, 55

Hard-coded string from FAX to Open-iAPS

  • Open-iAPS/FreeAPS/Sources/Modules/PreferencesEditor/PreferencesEditorStateModel.swift line 150
  • Open-iAPS/FreeAPSWatch WatchKit Extension/ComplicationController.swift lines 62, 81

[all branches] - ResistanceLowersTarget does not work

Describe the bug
due to this line the oref functionality resistance_lowers_target does not work as it is always false

To Reproduce
Steps to reproduce the behavior:

  1. activate that setting in preferences
  2. watch for an autosens >1
  3. see if target in popup will be lower when from from profile
  4. See that is the same, which would be an error and target is not adjusted due to the setting in oref

Expected behavior
target need to be lower than profile target

Solution
case resistanceLowersTarget = "resistance_lowers_target" in preferences.swift (see above)

Inconsistent ExternalInsulin type enum and isExternalInsulin attribute

With the #93 the model PumpHistoryEvent is modified to add external insulin Type and a isExternalInsulin boolean :

struct type
CleanShot 2024-04-14 at 11 20 24 CleanShot 2024-04-14 at 11 20 54

However, when a external insulin is added with the interface, only the externalInsulin bool is defined to true (the type = bolus and no externalInsulin) :
CleanShot 2024-04-14 at 11 24 50

I also found a function never used by any code where isExternalInsulin = true
CleanShot 2024-04-14 at 11 22 52

The externalInsulinType is used by NS (and only by NS) to build a nightscoutTreatement object with a function to deduce the type : https://github.com/nightscout/Open-iAPS/blob/8ebd52a69612977cf705c5843d71250eb23bb009/FreeAPS/Sources/APS/Storage/PumpHistoryStorage.swift#L260

My proposal will be to remove the externalInsulin Type in Event Type and create a specific type enum for NS, avoid to have inconsistent between type and isExtrernalInsulin attribue.

ISF value in enacted pop-up "pill" shows only final ISF

Describe the bug
In the pop-up pill ISF value shows final ISF two times, "ISF: 2.2 > 2.2"

To Reproduce
Steps to reproduce the behavior:

  1. Enable an Override with adjustment to ISF
  2. Click on loop symbol to bring up the pill..'
  3. See error

Expected behavior
correct should be in my example "ISF:3.0 > 2.2"

Screenshots
IMG_54F0D4D19230-1

  • Trio version, branch and git reference (see Trio Settings)
    v0.1.0

[alpha-issue] - App crash related to calibration

OiAPS crashed.

Build: alpha de9cd83

The sequence of events might have been different, but it apparently happened when selecting Glucose Direct and trying to open the app when it's not installed.

To reproduce:
Select Glucose Direct from GCM value
Tap Open Glucose Direct

--> App crash, force close does not resume operation of the app (black screen)

image

The crash only happened on first attempt, after a rebuild/launch from Xcode, a warning popped up:
image

Remove the experimental in Temp target view

Is your feature request related to a problem? Please describe.
The temp target view allows to activate a experimental slider to "simulate" a target in regard of the % basal insulin (HBT) . Now, the implementation is done with Override profil and not useful to stay here
CleanShot 2024-05-06 at 13 41 56

Describe the solution you'd like
remove this part in the view and all code associated in HomeView and others...

Describe alternatives you've considered
no object

Additional context

Alarmtone when the app is killed

Would it be possible to play an alarm sound when the app is killed?
Some users like to clean up the task list and the app accidentally gets killed.
The Libre3 app has such a function. This has proven to be so beneficial.

Duplicated carb entries

--Added 30g of carbs at 5:58 a.m. on May 11 (log attached).
--But 2 entries appeared in the History screen in Trio

IMG_9008
IMG_9009

I deleted the second errant entry. So sorry, don't have a screenshot for that. Should have captured that first.

--Running Trio v0.1.0
--Branch: dev6f862aa
--Omnipod Dash, G7

log-dupe-carb-entry.txt

This may be an intermittent bug -- and possibly only a display issue. Same issue was reported here in the iAPS Github Issues area and may be related to writing to Health:

Artificial-Pancreas/iAPS#450

A potential fix was suggested here:
Artificial-Pancreas/iAPS#564

Could be user error, but I'm pretty sure I didn't enter this twice.

I still have iAPS 4 on my iPhone 15, not sure if that could be related. I've been seeing how it differs from what Trio advises.

But I've experienced the bug reported above (Issue 450 in iAPS), and it was thought to be Apple Health related, so I turned it off. I've turned it off in Trio now as well.

Identifier Confusion

Describe the bug
With our current configuration, we have Identifier Names identical to another app,

To Reproduce
Steps to reproduce the behavior:

  1. Delete as many XC identifiers as possible
  2. Run Trio Action: Add Identifiers

Examine what is in the Name Column and what is in the Identifier Column for identifiers under Apple Developer account.

Expected behavior
The names should not be subject to confusion

Screenshots
Note that the Name columns for iAPS and Trio is the same, but each have unique Identifier.

Identifiers created by GitHub actions:

identifiers-from-github

Identifier created with Xcode build:

indentifier-from-xcode

Preference Options Need Clear Confirmation Feedback On Save

When saving a setting, better feedback should be given to the user whether it was saved or not.

Currently, the way to check an item has been saved is to re-enter to the menu after saving to check the value. Some users may have haptic feedback disabled?

Menu Items to be address (but not limited to):

  • Pump Settings (no pump attached, should there be a warning on save?)
  • Basal Profile (no pump attached, should there be a warning on save?)
  • Insulin Sensitivities (haptic feedback, not indicative of a success)
  • Carb Ratios (haptic feedback, not indicative of a success)
  • Target Glucose (haptic feedback, not indicative of a success)

Submodule tests are not run automatically, failure in CalibrationsTest

Describe the bug

  1. When running Tests in Xcode, expect submodule tests to run automatically
  2. The CalibrationsTests in FreeAPSTest is failing and should be fixed

To Reproduce
Steps to reproduce the behavior:

  1. Open Xcode
  2. Build to a simulator
  3. Run Tests

Expected behavior

  1. All tests should run (including submodules.
  2. All tests should pass

The 4 XCTAssert line that fail are: lines 34, 36, 38 and 42 for FreeAPSTests/CalibrationsTests.swift

Incorrect Persistent Notification

Notification is present every loop cycle despite having notifications turned off.
The notification will immediately disappear, within 1 second.

Config notes:
Freestyle Libre 2
DASH

Use the correct app name in LoopKit submodules

@marionbarker has been creating PRs towards LoopKit for the submodules we use in OiAPS to replace โ€œLoopโ€ with the actual app name.

Until the PRs are accepted, we will point OiAPS to the commits in the loopandlearn branches used for the PRs.

@marionbarker, please post links to the relevant branches here so we can easily set this up for testing. Thanks!

Expiration date for browser build

The app is lacking Expiration Date for Browser Build/Testflight.

I recently added this feature for LoopFollow, I could do the same for this app.

image

Conversion Notification Bug

image

Dev branch with live activities and loop_dev_submodules

Notification shows mg/dL when mmol/L selected as glucose value.

Transmitter also shows N/A.

Add branch+commit to the "What to Test" field in TestFlight

Propose to add this to OiAPS, as previously done here by @MikePlante1:
Artificial-Pancreas/iAPS#360

This PR includes a feature for uploading the branch name and git reference as a โ€œchangelogโ€ to TestFlight, displayed under โ€œWhat to Testโ€ for each build. However , there is a bug in AppStore Connect / TestFlight, where fastlane fails to upload changelog if it was never entered before.

The workaround is to make a manual โ€œTest Detailsโ€ entry from AppStoreConnect (ASC), then build again. Then, the branch and git ref will be displayed under "What to Test" in both TestFlight and ASC.

This is a known issue, with various proposed workarounds including this one:
fastlane/fastlane#16129 (comment)

(This was originally included in another PR, but did not belong there ,hence I created this issue report instead)
Asssigned to @MikePlante1, including the required documentation :-)

Guardrails for TT & Profiles

Is your feature request related to a problem? Please describe.
A safety concern when it is possible to apply a TT or Profile override with bg target below oref (safety) limitation of 4.4 mmol/L.

Describe the solution you'd like
TT & Profile overrides should be limited to 4.4. And in setting > Target glucose > not be able to set below 4.4 Oref will automatically limit set target glucose to 4.4 but not limit TT & Profiles

Describe alternatives you've considered
A warning when to apply a TT or profile when below oref safety limit 4.4

[feature request] Display profiles/overrides in Nightscout

Displaying profiles/overrides in NS is important for the adoption of these features by remote caregivers. This is very relevant with the introduction of refactored shortcuts in #144.

iAPS display this by using Exercise events, as these are displayed in both the main chart and in Day to day reports.

Enact Bolus has no sanity check

The field to enter a bolus doesn't appear to have a proper two-way sanity check. Whilst it checks for a max bolus, it doesn't check for a minimum bolus nor does it respect the Bolus Increment. This means you can enter impossible values such as 0.0001U. This makes the app crash immediately after running FaceID. Moreover, for the 2nd issue, if your Bolus Increment is set to 0.5: you can still try to bolus 0.025 or, as another example, 1.025 - whilst neither ought to be possible with 0.5 increments. Ideally, minimum bolus is tied to bolus increment.

Medtronic 754, Trio Dev, iOS 17.5 and lower.

[Apple Watch] - Manage temp target and override profile in the same button

I tried to mix with the button "temp target" on the apple Watch the capability to choose a temp target or a override preset. The result is available here :

  • start a temporary target
  • cancel a temporary target
  • start a profile override
  • cancel a profile override

Currently the code is available but there is too many duplicate code in this version. I need to refactor the first implementation of profile override in swift (storage, use swiftInject, implement observer,...).

What's your though ?

  • ๐Ÿ‘ for this feature
  • ๐Ÿ˜• for this feature with updates
  • ๐Ÿ‘Ž for other solution to manage override profile / temp target

CleanShot 2024-04-28 at 21 03 49

Introduce proper guardrails for bolus entries (pump bolus and external insulin)

There is currently no guardrail / max limit for logging of external insulin ("Bolus without actually bolusing"). This can cause issues with dISF, since even after deleting an erroneous entry, the bolus dose will still linger in the TDD storage in CoreData, and there is no way to reset this except by deleting the app.

Suggestion: Introduce max limit for external bolus. Possibly based on the pump setting for max bolus. @

Please note that some might set a low max bolus for the pump to reduce the risk of large doses causing "tunneling". Some also combine this strategy by taking the bulk of the meal bolus by pen/syringe. In this case, limiting external bolus to the max pump bolus will be inconvenient. Possibly 3 - 10 x max pump bolus would be appropriate? Otherwise, we need a separate setting for max external bolus.

This has been discussed at length in the iAPS project, but I can't find the discussion right now.

Connect Cockpit Diabetes App to Trio Directly - by Lukas Schuster (@schusterlich)

From Lukas Schuster @schusterlich (primary dev of Cockpit) to connect Trio data directly to Cockpit without going through Apple Health. Doing so will enable Trio users to access the premium membership for free to view their Trio data and data analysis in Cockpit.

what needs to be done is:

Check if the App is Installed:
In the app that is calling your custom URL scheme, you need to first check if your app can handle the URL. This can be done using the canOpenURL: method of UIApplication. This method returns a Boolean indicating whether or not your app can handle the URL scheme.

Code-Snippet:

if UIApplication.shared.canOpenURL(URL(string: "diabetes-cockpit://")!) {
    UIApplication.shared.open(URL(string: "diabetes-cockpit://?activate=iaps")!, options: [:], completionHandler: nil)
} else {
    // App is not installed, open App Store link
    UIApplication.shared.open(URL(string: "[https://apps.apple.com/us/app/diabetes-cockpit/id1580577116")!](https://apps.apple.com/us/app/diabetes-cockpit/id1580577116%22)!), options: [:], completionHandler: nil)
}

Configure URL Schemes:
Make sure that the calling app has your custom URL scheme listed in its Info.plist under LSApplicationQueriesSchemes. This step is necessary for the app to check if your app is installed:

Code-Snippet:

 <key>LSApplicationQueriesSchemes</key>
<array>
    <string>diabetes-cockpit</string>
</array>

[alpha issue] - Libre calibration: reset calibration at sensor change?

Since earlier days, the calibration of Libre sensors has been persisted across sensor sessions. I believe it would be more appropriate to reset the calibration at sensor change. Is this possible?

I did notice a function that reset the calibration when switching to another type of CGM. Perhaps this could be extended to switching to a new Libre sensor?

Add a separate setting for Sigmoid Adjustment Factor vs Logarithmic Adjustment Factor

I think a new setting should be added for Adjustment Factor so Logarithmic DynamicISF can default to 0.8 and Sigmoid DynamicISF can default to 0.5. This prevents new users from starting DynamicISF in Logarithmic mode with a default of 0.5 which seems to often lead to prolonged highs for many people. Also helpful for those who switch between Logarithmic and Sigmoid depending on their situation.

Live Activity Chart doens't populate as it should

Problem:
The live activity only shows the values when I entered the app.
The data that was backfilled or in between data the openings of the app was in the widget.

Without the simulator/NS it works fine (G7 + Dash instead), but I don't understand why it doesn't display the backfilled data aswell. Because the data is in the app so it should also show in the Live activity right?

Smartphone:

  • iPhone 15 Pro Max
  • Apple Watch Ultra 2

Settings:

  • Simulator Pump
  • Nightscout CGM Source
  • Backfilled Glucose from nightscout
  • Live activities branch Merged with Dev_dependencies branch

image
image
image
image
image
image

Libre Alarms Using Non Calibrated Data

Describe the bug
Using Libre, when a high or low notification is sounded, the app appears to be using non calibrated data to trigger the alarm, despite being lower (in this case) than the alarm trigger point.

To Reproduce
Steps to reproduce the behavior:

  1. Calibrate Libre sensor to a value below default
  2. Observe when default value in GCM settings exceeds threshold, but calibrated value is below.
  3. Observe high alert

Expected behavior
A clear and concise description of what you expected to happen.
High alert only applies to calibrated values.

Screenshots
If applicable, add screenshots to help explain your problem.

image
image
image
Smartphone (please complete the following information): iPhone 15 Pro

Setup Information (please complete the following information):

  • Pump type - DASH
  • CGM type and CGM app - Freestyle Libre 2, Libre App (don't use)
  • Trio version, branch and git reference (see Trio Settings) Open-iAPS Alpha c8ceccc

Additional context
Add any other context about the problem here.

Remove Profiles from Open-iAPS Oref and move to Swift

Copied from @dnzxy's comment in Discord (https://discord.com/channels/1020905149037813862/1226878954535649351/1228787378529894411)

the way this currently works is this:

  • you create a profile or load a profile preset, both are stored in CoreData

  • that is then read into a Swift object in memory, and stored as another CoreData entity, Oref2_Variables

  • that is read again, then passed into JSON and passed to the oref algorithm

  • there all those variables, mostly boolean ones, are read from JSON, re-instantiated in the JS algo code and simply just to do some if else checks or to set a few variables to true/false or set %s

The this should work is all swift based and the only things that need to be passed to oref would be the current basal rate, the current isf rate, the current cr rate and all those modified by the selected %.

If you set the profile to disable SMBs, that can also happen Swift-based

determine basal should ideally only do exactly that: determine required insulin, not have a logic for adjusting setting metrics or basal rates.

[Alpha] - Heartbeat is not available with pump as heartbeat

No restarts in between. Dev happily loops on NS CGM with phone locked, alpha only loops with phone unlocked. Restarting now to see if it makes a difference.

Behaviour confirmed after restart. OiAPS open just before I close phone screen. Cycle home with phone/pump/orange in jacket pocket. On arrival home Live Activity is stale and OiAPS alpha loop is red. Manually force a loop and it goes green.

Live Activity Chart Manual Scaling

As a user I would like to have the option define my own minimum and maximum scaling for the Live Activity Chart, so I can better view the information that is relevant to me.

  • Minimum Y setting for chart (Default: auto)
  • Maximum Y setting for chart (Default: auto)
  • X Setting setting for chart (Default: auto)

Libre Calibration Regression

Since the move to Libre submodule the ability to calibrate outside of setting a Boolean flag in the code has been removed with this commit

iAPS allowed direct "blood glucose level" insertion and it worked out the calibration slope + intercept for you. Functionality should return to this state.

Feature request: Add button to open the CGM app or source in the general CGM settings view

Feature request: Add button to open the CGM app or source in the general CGM settings view.

A button that opens the CGM app (or Libre direct) will be convenient here when #24 is merged, as tapping the BG value will no longer opens the app. This button can be the same for all CGMs, and we can use the same mapping of app urls that we used previously when tapping the BG value.

I propose to put this button near the top or middle, without having to scroll down and easily tappable without risk of tapping another button or setting.

Screenshot from the alpha branch (the double Close button is described in #69):
image

Build: https://github.com/nightscout/Open-iAPS/tree/d529658aed9d14275878f799e238f656fabe881d

Medtronic Pump connection maxBolus mismatch

Issue

This may have been operator error but I was not able to modify settings on iAPS to lower the maxBolus value in the app to connect to a Medtronic pump. I had to modify the pump maxBolus to enable the connection.

  • default maxBolus for new build is 10 U

Configuration:

  • iPhone 8, iOS 16.7.5
  • iAPS v2.3.3(1)
  • commit f404fc4
  • Medtronic 515 pump
  • New build on test phone

Steps:

  • MDT 515 has maxBolus set to 7
  • When trying to attach pump, got Max setting exceeded
  • Modified the iAPS, Pump Settings to Max Bolus of 7 (default is 10 for new build)
  • Still got connection error (confirmed that iAPS pump settings does say maxBolus of 7)
  • Modified MDT 515 maxBolus to 10, then could connect
  • After connection - examined maxBolus on pump and iAPS, both read 7 as desired

EmaLink doesn't appear to be polled in intervals for battery alarm

There's an option to have the app alert you when the battery of your EmaLink goes below a user adjustable threshold. (Eg: I have it set to < 30% = alarm.)

However, the app never seems to query the EmaLink (for that variable) unless you go to Pump and tap your EmaLink to view status and reveal the settings. It will only at that moment ask for the battery level, show it and trigger the notification/alarm - at which point it's a bit late.

It'd be nice if the app queries the EmaLink battery once every x hours. Maybe every 3 hours or so?
Note: had the same issue in the previous iteration of the app, where it was mentioned that it did work fine for OrangeLink.

Medtronic 754 + EmaLink, Trio Dev, iOS 17.5.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.