From 163c043492d4d7f8c07779a3d104d454192b013d Mon Sep 17 00:00:00 2001 From: Andy Rozman Date: Wed, 7 Aug 2019 11:59:47 +0100 Subject: [PATCH] - preliminary fix for #1940 (if calculated voltage is under 0, we set it to 1%) --- .../plugins/pump/medtronic/data/dto/BatteryStatusDTO.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BatteryStatusDTO.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BatteryStatusDTO.java index d12260bb75..c8bd2347d0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BatteryStatusDTO.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BatteryStatusDTO.java @@ -27,6 +27,9 @@ public class BatteryStatusDTO { int percentInt = (int) (percent * 100.0d); + if (percentInt<0) + percentInt = 1; + if (percentInt > 100) percentInt = 100;