nightscout / Trio

MIT License
64 stars 259 forks source link

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

Closed bjornoleh closed 4 months ago

bjornoleh commented 4 months ago

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?

avouspierre commented 4 months ago

@bjornoleh do you test with a real FresStyle ? I added a code in response of the libre transmitter cgm delegate event but the event is not launched by fake libre style.

https://github.com/nightscout/Open-iAPS/blob/e4fa3594771272653f2b6cd2a4f895e1a116aa97/FreeAPS/Sources/APS/CGM/PluginSource.swift#L108

bjornoleh commented 4 months ago

@bjornoleh do you test with a real FresStyle ? I added a code in response of the libre transmitter cgm delegate event but the event is not launched by fake libre style.

https://github.com/nightscout/Open-iAPS/blob/e4fa3594771272653f2b6cd2a4f895e1a116aa97/FreeAPS/Sources/APS/CGM/PluginSource.swift#L108

Ah, thanks, no I did not test at all, I just thought the calibrations were still persisted.

I only noticed this from the commit note, I thought it only gave a notification that said the user should consider deleting the calibration. If it resets the calibration, then all is good!

https://github.com/nightscout/Open-iAPS/commit/491ddf29c452c4a881b1d49efaccaf79343876ff:

add notification to remove calibration when change CGM or sensors
bjornoleh commented 4 months ago

@kylmcw confirmed that calibration reset once a new sensor is paired via the “pair new sensor” flow. 🎉 Closing the issue