From de9d2da68dafb848d7970948493644cbb388edcc Mon Sep 17 00:00:00 2001 From: gregorybel Date: Thu, 28 Nov 2019 22:15:56 +0100 Subject: [PATCH 1/2] show Battery info in days instead of percent for Combo --- .../general/overview/StatuslightHandler.java | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatuslightHandler.java b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatuslightHandler.java index 23c3fd2cec..4e199468d3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatuslightHandler.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatuslightHandler.java @@ -12,6 +12,7 @@ import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.general.careportal.CareportalFragment; import info.nightscout.androidaps.plugins.general.nsclient.data.NSSettingsStatus; +import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; import info.nightscout.androidaps.utils.DecimalFormatter; import info.nightscout.androidaps.utils.SP; import info.nightscout.androidaps.utils.SetWarnColor; @@ -34,10 +35,14 @@ class StatuslightHandler { applyStatuslight("sage", CareportalEvent.SENSORCHANGE, sageView, "SEN", 164, 166); - double batteryLevel = pump.isInitialized() ? pump.getBatteryLevel() : -1; - applyStatuslightLevel(R.string.key_statuslights_bat_critical, 5.0, - R.string.key_statuslights_bat_warning, 22.0, - batteryView, "BAT", batteryLevel); + if (pump.model() != PumpType.AccuChekCombo) { + double batteryLevel = pump.isInitialized() ? pump.getBatteryLevel() : -1; + applyStatuslightLevel(R.string.key_statuslights_bat_critical, 5.0, + R.string.key_statuslights_bat_warning, 22.0, + batteryView, "BAT", batteryLevel); + } else { + applyStatuslight("page", CareportalEvent.PUMPBATTERYCHANGE, batteryView, "BAT", 504, 240); + } } @@ -105,9 +110,14 @@ class StatuslightHandler { handleAge("sage", CareportalEvent.SENSORCHANGE, sageView, "SEN ", 164, 166); - handleLevel(R.string.key_statuslights_bat_critical, 26.0, - R.string.key_statuslights_bat_warning, 51.0, - batteryView, "BAT ", pump.getBatteryLevel()); + if (pump.model() != PumpType.AccuChekCombo) { + handleLevel(R.string.key_statuslights_bat_critical, 26.0, + R.string.key_statuslights_bat_warning, 51.0, + batteryView, "BAT ", pump.getBatteryLevel()); + } else { + handleAge("bage", CareportalEvent.PUMPBATTERYCHANGE, batteryView, "BAT ", + 336, 240); + } } void handleAge(String nsSettingPlugin, String eventName, TextView view, String text, From db2c67502423838dbef3302eae8c651c787ab62d Mon Sep 17 00:00:00 2001 From: gregorybel Date: Fri, 29 Nov 2019 21:48:35 +0100 Subject: [PATCH 2/2] fix page -> bage --- .../androidaps/plugins/general/overview/StatuslightHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatuslightHandler.java b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatuslightHandler.java index 4e199468d3..15d9f11a2b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatuslightHandler.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatuslightHandler.java @@ -41,7 +41,7 @@ class StatuslightHandler { R.string.key_statuslights_bat_warning, 22.0, batteryView, "BAT", batteryLevel); } else { - applyStatuslight("page", CareportalEvent.PUMPBATTERYCHANGE, batteryView, "BAT", 504, 240); + applyStatuslight("bage", CareportalEvent.PUMPBATTERYCHANGE, batteryView, "BAT", 504, 240); } }