Restore pump status in Nightscout device status uploads#2460
Conversation
Populate pumpManagerStatus, pumpStatusHighlight, cgmManagerStatus, and lastReservoirValue on the dosing decisions NightscoutService uploads, so the devicestatus pump object (clock, reservoir, model, ...) is no longer omitted.
Test✅ The pump item is uploaded with this fix. Reproduce the ProblemExamine the devicestatus downloads taken from next-dev when testing the customization for negative_insulin (see loopandlearn/customization#79). There is no pump item in those downloads. This was first noticed when using LoopFollow. This caused an issue when plotting forecast without knowing pump clock. (A work-around is implemented for LoopFollow to fix this issue. Mentioning it because this is what triggered looking at this code.) Test the fixBuild the latest version of LoopWorkspace Download devicestatus and observe that the pump field is now found. In a local analysis folder, I have several different device downloads from a Loop Nightscout test site URL. I also downloaded some from my personal Nightscout URL.
|
marionbarker
left a comment
There was a problem hiding this comment.
Approve from test. Relying on @ps2 for code review.
next-dev's LoopDataManager stopped setting pump and CGM status on the dosing decisions NightscoutService uploads, so devicestatus no longer includes the pump object (clock, reservoir, model, and so on). This puts those fields back on the updateRemoteRecommendation and manual bolus decisions, matching what dev does in update(for:).
About cgmManagerStatus: Nightscout doesn't upload it, so nothing cgm-related changes in devicestatus. It's part of the stored dosing decision, which dev populates and next-dev left empty, so I restored it along with the pump fields.