show Battery info in days instead of percent for Combo

This commit is contained in:
gregorybel 2019-11-28 22:15:56 +01:00
parent b8ba94fa30
commit de9d2da68d

View file

@ -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);
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);
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,