Skip to content

Conversation

@dsnallfot
Copy link
Contributor

Issue:
The OpenAPS pill always shows enacted bg in mg/dl and does not convert units to mmol/l when mmol/l is the chosen user setting.

After some troubleshooting together with @bjornoleh and @JeremyStorring today we found out that there currently is no mmol units conversion in the code for prop.lastEnacted.bg. All other bg conversions in openaps.js works as expected.

Solution:
This PR adds the units conversion for prop.lastEnacted.bg, and resolves the issue.

Testing
The issue was identified while using iAPS as devicestatus uploader, and the code change have been tested to work with iAPS as uploader, but are most likely relevant for openAPS uploads in general (not tested).

Please review when suitable for you, and get back with any questions @sulkaharo @bewest

@bjornoleh
Copy link
Contributor

The fix was confirmed to be working here, also using iAPS. Thanks @dsnallfot!

@bjornoleh
Copy link
Contributor

Before fix:
image

After fix:
image

@Der-Schubi
Copy link

I can confirm the problem itself using AAPS and NS15
NS15

@bjornoleh
Copy link
Contributor

@bewest , this PR solves a problem for mmol users. I have tested it for some time now, and it works as expected here. Perhaps consider merging this? Thanks!

@dsnallfot dsnallfot closed this Aug 31, 2024
@dsnallfot
Copy link
Contributor Author

Closing PR due to no interest in this fix

@dnzxy
Copy link

dnzxy commented Sep 16, 2024

@bewest @sulkaharo is there interest for this PR to be re-opened, actually looked at and possibly accepted?

@dsnallfot dsnallfot deleted the dev_openaps_mmol_fix branch September 30, 2024 00:31
@dsnallfot dsnallfot restored the dev_openaps_mmol_fix branch December 7, 2024 09:19
@dsnallfot
Copy link
Contributor Author

Reopened by request from @bjornoleh

@dsnallfot dsnallfot reopened this Dec 7, 2024
@bjornoleh
Copy link
Contributor

@bewest , could you please have a look at this? The changes has been well tested for months.

@olorinmaia
Copy link

olorinmaia commented Dec 9, 2024

Does this fix the issue of duplicate messages in OpenAPS-log also? Or is that an AAPS-issue solely?

See issue: nightscout/AndroidAPS#3571

@bewest
Copy link
Member

bewest commented Dec 13, 2024

This is an important fix. Thanks for @bjornoleh's additional efforts to bring this to my attention. There is a unit test for this which fails. I'm altering the code slightly in order to allow the tests to pass that makes it similar to code nearby and it allows the tests to pass. It would be a huge help to consider augmenting the openaps test to test for the mmol detection.
Thanks!

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