From 9e770601f3a34257a943421b7031a3b5558fd3a4 Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Sat, 1 May 2021 19:19:18 +0200 Subject: [PATCH] merge CommandConfirmed and CommandDenied --- .../plugins/pump/omnipod/dash/driver/event/PodEvent.kt | 4 +--- .../dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/event/PodEvent.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/event/PodEvent.kt index dfee0dfcb5..4e5fb865d5 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/event/PodEvent.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/event/PodEvent.kt @@ -66,7 +66,5 @@ sealed class PodEvent { } } - data class CommandConfirmed(val historyId: String) : PodEvent() - - data class CommandDenied(val historyId: String) : PodEvent() + data class CommandConfirmed(val historyId: String, success: Boolean) : PodEvent() } diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt index 2f2f5162e7..831060673b 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt @@ -224,9 +224,9 @@ class OmnipodDashPodStateManagerImpl @Inject constructor( else { podState.activeCommand = null if (sequenceNumberOfLastProgrammingCommand == sequence) - source.onSuccess(PodEvent.CommandConfirmed(historyId)) + source.onSuccess(PodEvent.CommandConfirmed(historyId, true)) else - source.onSuccess(PodEvent.CommandDenied(historyId)) + source.onSuccess(PodEvent.CommandConfirmed(historyId, false)) } } ?: source.onComplete() // no active programming command