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

Set median of lower and upper correction range bound when importing L… #253

Merged

Conversation

kskandis
Copy link
Contributor

@kskandis kskandis commented May 31, 2024

Resolves NS Settings Import: Set median of lower and upper correction range bound when importing Loop settings by:

Sets Trio's target correction low and high to median of lower and upper target range when NS profile's enteredBy is Loop. Rounds median value to 0 or 1 significant digits depending on Glucose unit (0 for mg/dL, 1 for mmol/L).

EDIT:
This issue probably applies to AAPS, too, since it also uses a low and high target. examples.json shows its profileJson with target_low and target_high. I cannot test it w/out having an actual "openaps://AndroidAPS" profile though.

I think merged PR, Remove unused Import Settings in JSON that cause errors decoding JSON #249, also applies to AAPS.

@bjornoleh
Copy link
Contributor

I think perhaps AAPS targets should be handled the same way as Trio targets, using only / mainly the lower target, instead of the median of lower/upper target range, as seems to be the case in this PR currently. We use the same algorithm, and I would expect the same behaviour regarding targets.

From https://androidaps.readthedocs.io/en/latest/Configuration/Config-Builder.html#closed-loop:
Please note: In closed loop mode a single target instead of target range (i.e. 5,5 mmol or 100 mg/dl instead of 5,0 - 7,0 mmol or 90 - 125 mg/dl) is recommended.

Copy link
Contributor

@dnzxy dnzxy left a comment

Choose a reason for hiding this comment

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

LGTM (based on code review only, as I do not use Loop and cannot test Loop-imported settings).

@dnzxy
Copy link
Contributor

dnzxy commented Jun 7, 2024

@marionbarker or @bjorkert – could you please test this, and if good, give your approval please?

@dnzxy dnzxy added the enhancement New feature or request label Jun 7, 2024
@marionbarker
Copy link
Contributor

Summary

Success: This PR worked as expected.

Testing Details

I applied this patch to dev (commit 4d6e102).

  • Previously I had imported settings from Nightscout (Loop user).
  • My Loop range is 90 to 100 mg/dL.
  • My imported setting using this dev is 90 mg/dL.

After applying the patch and building again, I imported my settings again.

  • My imported setting is now 95 mg/dL.

@bjornoleh
Copy link
Contributor

Merging with two approvals

@bjornoleh bjornoleh merged commit aeb4ee1 into nightscout:dev Jun 8, 2024
1 check passed
This was referenced Jun 10, 2024
mountrcg pushed a commit to mountrcg/Trio that referenced this pull request Jun 15, 2024
…ttingsLoopMedianTarget

Set median of lower and upper correction range bound when importing L…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NS Settings Import: Set median of lower and upper correction range bound when importing Loop settings
6 participants