nightscout / cgm-remote-monitor

nightscout web monitor
GNU Affero General Public License v3.0
2.4k stars 71.67k forks source link

Fix missing mmol unit conversion for lastEnacted.bg in openaps.js #8234

Closed dsnallfot closed 1 month ago

dsnallfot commented 7 months ago

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 commented 7 months ago

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

bjornoleh commented 7 months ago

Before fix: image

After fix: image

Der-Schubi commented 7 months ago

I can confirm the problem itself using AAPS and NS15 NS15

bjornoleh commented 6 months ago

@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 commented 1 month ago

Closing PR due to no interest in this fix

dnzxy commented 2 weeks ago

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