From 26321344eb4637ee46187d4a9a1326c59345e668 Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Sat, 31 Jul 2021 20:17:59 +0200 Subject: [PATCH] fix compiler warnings --- .../omnipod/dash/driver/comm/callbacks/BleCommCallbacks.kt | 4 ++-- .../pump/omnipod/dash/driver/comm/message/MessageIO.kt | 4 ++-- .../pump/omnipod/dash/driver/pod/definition/BasalProgram.kt | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/callbacks/BleCommCallbacks.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/callbacks/BleCommCallbacks.kt index 6e193193b3..63d785e10c 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/callbacks/BleCommCallbacks.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/callbacks/BleCommCallbacks.kt @@ -211,8 +211,8 @@ class BleCommCallbacks( fun resetConnection() { aapsLogger.debug(LTag.PUMPBTCOMM, "Reset connection") - connected?.countDown() - serviceDiscoveryComplete?.countDown() + connected.countDown() + serviceDiscoveryComplete.countDown() connected = CountDownLatch(1) serviceDiscoveryComplete = CountDownLatch(1) flushConfirmationQueue() diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/message/MessageIO.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/message/MessageIO.kt index 0aa3033894..8c20958cf3 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/message/MessageIO.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/message/MessageIO.kt @@ -37,8 +37,8 @@ class MessageIO( fun sendMessage(msg: MessagePacket): MessageSendResult { val foundRTS = cmdBleIO.flushIncomingQueue() if (foundRTS) { - val msg = receiveMessage(false) - aapsLogger.warn(LTag.PUMPBTCOMM, "sendMessage received message=$msg") + val receivedMessage = receiveMessage(false) + aapsLogger.warn(LTag.PUMPBTCOMM, "sendMessage received message=$receivedMessage") throw IllegalStateException("Received message while trying to send") } dataBleIO.flushIncomingQueue() diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BasalProgram.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BasalProgram.kt index 553051444b..993874b5e3 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BasalProgram.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BasalProgram.kt @@ -15,8 +15,6 @@ class BasalProgram( fun hasZeroUnitSegments() = segments.any { it.basalRateInHundredthUnitsPerHour == 0 } - fun isZeroBasal() = segments.sumBy(Segment::basalRateInHundredthUnitsPerHour) == 0 - fun rateAt(date: Date): Double { val instance = Calendar.getInstance() instance.time = date