From 80e8d094df24f9372300edc9abe9af82487c9518 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Thu, 6 Aug 2020 23:01:28 +0200 Subject: [PATCH] Improve pod status text --- .../plugins/pump/omnipod/OmnipodFragment.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodFragment.kt index ad6ff43e73..667961be61 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodFragment.kt @@ -23,6 +23,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyL import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodStatusRequest import info.nightscout.androidaps.plugins.pump.omnipod.defs.PodDeviceState +import info.nightscout.androidaps.plugins.pump.omnipod.defs.SetupProgress import info.nightscout.androidaps.plugins.pump.omnipod.dialogs.PodManagementActivity import info.nightscout.androidaps.plugins.pump.omnipod.driver.OmnipodDriverState import info.nightscout.androidaps.plugins.pump.omnipod.driver.OmnipodPumpStatus @@ -316,7 +317,17 @@ class OmnipodFragment : DaggerFragment() { } } - omnipod_pod_status.text = stateText + " (" + omnipodPumpStatus.podSessionState.getSetupProgress().name + ")" + if (SetupProgress.COMPLETED.equals(omnipodPumpStatus.podSessionState.getSetupProgress())) { + if(omnipodPumpStatus.podSessionState.lastDeliveryStatus != null) { + stateText += " (last delivery status: " + omnipodPumpStatus.podSessionState.lastDeliveryStatus.name + ")" + } + } else { + if(omnipodPumpStatus.podSessionState.setupProgress != null) { + stateText += " (setup progress: " + omnipodPumpStatus.podSessionState.setupProgress.name + ")" + } + } + + omnipod_pod_status.text = stateText } val status = commandQueue.spannedStatus()