Skip to content

Add remote_guard, the remote command guard from LoopWorkspace#594 - #125

Open
bjorkert wants to merge 1 commit into
mainfrom
remote_guard
Open

bjorkert wants to merge 1 commit into
mainfrom
remote_guard

Conversation

@bjorkert

@bjorkert bjorkert commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

This adds the remote command guard from LoopKit/LoopWorkspace#594 as a customization for next-dev, dev and main. Loop accepts remote bolus and carb commands for up to 12 minutes and refuses a command when insulin or carbs were added that the sender had not seen, and the sender gets the reason. The 12 minutes need LoopFollow with loopandlearn/LoopFollow#842; other senders keep 5 minutes and only the send-time rule.

nextdev_remote_guard.patch is the PR source without tests and string catalog entries, with a few hunks moved so it applies together with remote_carb_edit in any order. dev_remote_guard.patch is a port for dev and main. It conflicts with remote_window on purpose, since both change the acceptance window in the same NightscoutService files, and it applies before or after every other customization.

Tested on real phones with a simulated pump on next-dev and dev, with LoopFollow #842 sending the commands.

The selector entry is in loopandlearn/lnl-scripts#118.

… next-dev, dev and main

The patches refuse a remote bolus or carb command when insulin or carbs were added that the sender had not seen, and accept those commands for up to 12 minutes. They conflict with remote_window, which changes the same window, and apply with every other customization in either order.
@bjorkert

Copy link
Copy Markdown
Member Author

Tests:

  • Each patch applies before and after every other customization for its branch, together with all of them in either order, and reverses cleanly. remote_window is refused in both directions, before and after this one.
  • The dev patch applies on main and is refused on next-dev; the next-dev patch is refused on main and dev
  • next-dev and dev build alone and together with the other customizations
  • The selector, with a local patch folder on main and next-dev: offered next to remote_carb_edit, and remote_window is not available once this is applied (and the other way round)
  • Real phones, next-dev and dev (Loop with a simulated pump, real push notifications, a test Nightscout):
    • a bolus delayed past a local bolus is refused with the insulin text, as a reply and as a Nightscout note
    • commands are accepted up to 12 minutes old and 2 minutes ahead, and refused outside that
    • a marker older than a local bolus refuses, a marker that covers it accepts
    • the 20 % limit, just under and just over
    • carbs: any unknown entry refuses
    • two commands sent together: only one passes
    • a bolus Loop has not uploaded yet counts as unknown
    • without a marker only treatments after the send time count
    • a bolus the pump refuses is reported as failed, and the next command goes through
  • Real phones, next-dev and dev, LoopFollow with Send the newest treatment seen with remote bolus and carb commands LoopFollow#842: the bolus carries the marker and is delivered, and a refused bolus shows "Command rejected: …" in LoopFollow's notification

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.

1 participant