Dev omnipod dash updates#1
Merged
Merged
Conversation
marionbarker
referenced
this pull request
in loopnlearn/OmniBLE
Jan 31, 2022
New Dash Pod images of pod bottom with blue needle cap
marionbarker
added a commit
that referenced
this pull request
Apr 6, 2024
OmniBLE parser improvements
threecee
pushed a commit
to threecee/OmniBLE
that referenced
this pull request
May 2, 2026
Phase 1 of wiring stopIssuingPodCommands / resumeIssuingPodCommands real gates. The state machine has been emitting these effects since B.2.d but nothing actually blocked pod commands at the orchestrator boundary — they were NSLog stubs in HandoffOrchestrator.execute. This commit adds the OMNIBLE-side machinery: - OmniBLEOwnership: new @published var commandsAllowed: Bool = true. Default-true for backwards compat. - OmniBLEPumpManager: new var commandsAllowedCheck: (() -> Bool)? callback. When set + returning false, enactBolus and enactTempBasal short-circuit with PumpManagerError.uncertainDelivery (retryable). Default nil = always-allow. - OmniBLEOwnership wires the callback at setPumpManager (watch lazy path) AND init (iOS construction path). Uses [weak self] capture so deallocation gracefully degrades to default-allow. CRITICAL design choice: callback closure pattern instead of back- reference. OmniBLEOwnership already holds OmniBLEPodOwner (the pump manager) strongly. Adding a back-reference would create a retain cycle. Callback closure with [weak self] sidesteps it. Loop-side wiring (HandoffOrchestrator.execute case .stopIssuingPod Commands → ownership.commandsAllowed = false) lands in the next Loop-submodule commit (Phase 3 of B.5). threecee-claude
threecee
pushed a commit
to threecee/OmniBLE
that referenced
this pull request
May 2, 2026
Three review items from code review of 1ec89ca: IMPORTANT — Add 2 unit tests for the gate actually firing in enactBolus + enactTempBasal. The 4 original tests verified the OmniBLEOwnership flag wiring + callback behavior; they did NOT verify the gate short-circuits the BLE path. A future refactor could remove the gate and the original tests would still pass — regression risk. New tests: testEnactBolus_shortCircuitsWhenCommandsNotAllowed, testEnactTempBasal_shortCircuitsWhenCommandsNotAllowed. Both assert synchronous completion within 0.5s (proves the gate fires before any async work) AND .uncertainDelivery as the returned error. IMPORTANT/SUGGESTION — Updated commandsAllowedCheck doc comment to: 1. Explain why .uncertainDelivery is the right error (DeviceDataManager .swift:833 suppresses the notification — avoids misleading "delivery uncertain" alert during handoff). 2. Document the SCOPE GAP: only enactBolus + enactTempBasal are gated. UI-driven manual paths (runTemporaryBasalProgram, cancelBolus, suspendDelivery, resumeDelivery) are NOT gated. Justification: handoff window is sub-second, UI paths are low-frequency, user is consciously triggering them. Marker for B.5.1 / B.7 followup if gap matters in practice. threecee-claude
threecee
pushed a commit
to threecee/OmniBLE
that referenced
this pull request
May 2, 2026
Adds testCommandGate_blocksDoseWhenCommandsNotAllowed to WatchAlgorithmEndToEndTests. Sets pump manager's commandsAllowedCheck callback to return false (simulating ownership.commandsAllowed = false in production), runs the algorithm iteration, asserts: - pod insulinDelivered did NOT change - no temp basal was installed (basalDeliveryState != .tempBasal) Complements the OmniBLEOwnershipTests unit tests (which verify the flag wiring in isolation). This integration test proves the gate prevents the dose from reaching the real emulated pod through the full plumbing (driver -> didRecommend -> enactRecommendedDose -> pumpManager.enactBolus/enactTempBasal -> short-circuit). Total WatchAlgorithmEndToEndTests now 5: full chain + 3 gate- suppression (B.6) + 1 command-gate (B.5). ~6-7 min wall-clock. threecee-claude
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR merges the omnipod-dash-updates branch that was originally pulled against master (in randallknutson OmniBLE) after adjustment for dev-protocols changes in LoopKit OmniBLE.
This brings the Loop-dev and FreeAPS implementations as close together as possible given the difference in protocols.
This also fixes the DisplayState function (tap on pod, scroll to bottom and tap DisplayState.)