Skip to content

Restore pump status in Nightscout device status uploads#2460

Open
bjorkert wants to merge 1 commit into
LoopKit:next-devfrom
bjorkert:restore-pump-devicestatus
Open

Restore pump status in Nightscout device status uploads#2460
bjorkert wants to merge 1 commit into
LoopKit:next-devfrom
bjorkert:restore-pump-devicestatus

Conversation

@bjorkert

@bjorkert bjorkert commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

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.

Populate pumpManagerStatus, pumpStatusHighlight, cgmManagerStatus, and lastReservoirValue on the dosing decisions NightscoutService uploads, so the devicestatus pump object (clock, reservoir, model, ...) is no longer omitted.
@marionbarker

Copy link
Copy Markdown
Contributor

Test

✅ The pump item is uploaded with this fix.

Reproduce the Problem

Examine 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 fix

Build the latest version of LoopWorkspace next-dev branch, commit 584bdaf.
Update the version of Loop to be bjorkert:restore-pump-devicestatus branch and build.

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.

filename Loop version config pump object?
2024-12-20T03_devicestatus.json v3.4.4 test phone, pump simulator
2026-07-15T13_devicestatus.json next-dev, commit d4271d1 test phone, pump simulator
2026-07-18T14_devicestatus.json next-dev, commit 584bdaf
Loop this PR, commit 7ed45e6
test phone, pump simulator
2026-03-01T17_devicestatus.json dev from March 1, 2026 personal phone, DASH Pod
2026-07-17T17_devicestatus.json next-dev before PR personal phone, DASH Pod
2026-07-18T22_devicestatus.json next-dev, commit 584bdaf
Loop this PR, commit 7ed45e6
personal phone, DASH Pod

@marionbarker marionbarker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve from test. Relying on @ps2 for code review.

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.

2 participants