From 0ce25c11903e6844376ee8498223acbdb44b46ce Mon Sep 17 00:00:00 2001 From: jbr7rr <> Date: Thu, 8 Jun 2023 22:22:42 +0200 Subject: [PATCH] Make sure patch can be primed when already filled before activation --- .../nightscout/pump/medtrum/ui/viewmodel/MedtrumViewModel.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/viewmodel/MedtrumViewModel.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/viewmodel/MedtrumViewModel.kt index 944f14796e..873e674116 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/viewmodel/MedtrumViewModel.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/viewmodel/MedtrumViewModel.kt @@ -170,6 +170,11 @@ class MedtrumViewModel @Inject constructor( } fun preparePatch() { + // Make sure patch step is updated when already filled + // TODO: Maybe a nicer solution for this + if (medtrumPump.pumpState == MedtrumPumpState.FILLED) { + updateSetupStep(SetupStep.FILLED) + } // New session, generate new session token, only do this when not connected if (medtrumService?.isConnected == false) { aapsLogger.info(LTag.PUMP, "preparePatch: new session")