From 7dc01cb1f84586428dff439232ce7e382bcb1e3f Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Mon, 31 May 2021 00:13:52 +0200 Subject: [PATCH] add comments --- .../plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt index 860b3e0122..19df819b2b 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt @@ -282,6 +282,7 @@ class OmnipodDashPumpPlugin @Inject constructor( .ignoreElement() ) ).toPumpEnactResult() + // TODO: on error, invalidateTemporaryBasal or sync it only after sending the command } private fun pumpSyncTempBasal( @@ -394,6 +395,8 @@ class OmnipodDashPumpPlugin @Inject constructor( val historyEntry = history.getById(confirmation.historyId) when (historyEntry.commandType) { OmnipodCommandType.CANCEL_TEMPORARY_BASAL -> + // We can't invalidate this command, + // and this is why it pumpSync-ed at this point if (confirmation.success) { pumpSync.syncStopTemporaryBasalWithPumpId( historyEntry.createdAt, @@ -403,6 +406,7 @@ class OmnipodDashPumpPlugin @Inject constructor( ) } OmnipodCommandType.SET_TEMPORARY_BASAL -> + // This treatment was synced before sending the command if (!confirmation.success) { pumpSync.invalidateTemporaryBasal(historyEntry.pumpId()) }