nightscout / Trio

MIT License
45 stars 125 forks source link

conversion of rT.variables in mg/dL #327

Open mountrcg opened 1 week ago

mountrcg commented 1 week ago

Needs to be done in parallel with https://github.com/nightscout/trio-oref/pull/30

This concerns mainly ISF as transmitted from oref to suggestion / enacted. So far I only found one instance where ISF is used.

So far ISF is always transfered from oref in the current user glucose unit, so if mmol/L is used it comes in mmol/L. Therefore currently no conversion is applied in Trio to ISF originating from oref. Drawback is also that a change of user glucose unit will not be reflected in ISF unless a new loop is calculated. Refer also to https://github.com/nightscout/trio-oref/issues/29

Also the watch app needs to adjusted as ISF may also be shown on watch.

mountrcg commented 1 week ago

I need a little help on the watch part, still throws an error in the conversion function https://github.com/nightscout/Trio/blob/a731a136c07af32ec41398aaf6313da39273f583/FreeAPS/Sources/Services/WatchManager/WatchManager.swift#L211

mountrcg commented 1 week ago
successfully tested! As Trio does not show ISF anywhere on UI, only watch can be used to review the changes. Old sitiuation - ISF is only shown converted after a new loop original state ISF after unit change, no new loop after new loop
Simulator Screenshot - Dev 13 mini - 2024-06-24 at 09 27 37 Simulator Screenshot - Dev 13 mini - 2024-06-24 at 09 27 59 Simulator Screenshot - Dev 13 mini - 2024-06-24 at 09 32 58
Simulator Screenshot - Apple Watch Series 7 (45mm) - 2024-06-24 at 09 27 39 Simulator Screenshot - Apple Watch Series 7 (45mm) - 2024-06-24 at 09 28 01 Simulator Screenshot - Apple Watch Series 7 (45mm) - 2024-06-24 at 09 32 52
After change, ISF is immediatly converted after changing units on phone. As it can be seen the popup still shows units from last loop, watch already has ISF converted. original state ISF after unit change, no new loop
Simulator Screenshot - Dev 13 mini - 2024-06-24 at 08 57 34 Simulator Screenshot - Dev 13 mini - 2024-06-24 at 08 57 47
Simulator Screenshot - Apple Watch Series 7 (45mm) - 2024-06-24 at 08 57 35 Simulator Screenshot - Apple Watch Series 7 (45mm) - 2024-06-24 at 08 57 49