show Battery info in days instead of percent for Combo
This commit is contained in:
parent
b8ba94fa30
commit
de9d2da68d
1 changed files with 17 additions and 7 deletions
|
@ -12,6 +12,7 @@ import info.nightscout.androidaps.interfaces.PumpInterface;
|
||||||
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
|
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
|
||||||
import info.nightscout.androidaps.plugins.general.careportal.CareportalFragment;
|
import info.nightscout.androidaps.plugins.general.careportal.CareportalFragment;
|
||||||
import info.nightscout.androidaps.plugins.general.nsclient.data.NSSettingsStatus;
|
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.DecimalFormatter;
|
||||||
import info.nightscout.androidaps.utils.SP;
|
import info.nightscout.androidaps.utils.SP;
|
||||||
import info.nightscout.androidaps.utils.SetWarnColor;
|
import info.nightscout.androidaps.utils.SetWarnColor;
|
||||||
|
@ -34,10 +35,14 @@ class StatuslightHandler {
|
||||||
|
|
||||||
applyStatuslight("sage", CareportalEvent.SENSORCHANGE, sageView, "SEN", 164, 166);
|
applyStatuslight("sage", CareportalEvent.SENSORCHANGE, sageView, "SEN", 164, 166);
|
||||||
|
|
||||||
double batteryLevel = pump.isInitialized() ? pump.getBatteryLevel() : -1;
|
if (pump.model() != PumpType.AccuChekCombo) {
|
||||||
applyStatuslightLevel(R.string.key_statuslights_bat_critical, 5.0,
|
double batteryLevel = pump.isInitialized() ? pump.getBatteryLevel() : -1;
|
||||||
R.string.key_statuslights_bat_warning, 22.0,
|
applyStatuslightLevel(R.string.key_statuslights_bat_critical, 5.0,
|
||||||
batteryView, "BAT", batteryLevel);
|
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 ",
|
handleAge("sage", CareportalEvent.SENSORCHANGE, sageView, "SEN ",
|
||||||
164, 166);
|
164, 166);
|
||||||
|
|
||||||
handleLevel(R.string.key_statuslights_bat_critical, 26.0,
|
if (pump.model() != PumpType.AccuChekCombo) {
|
||||||
R.string.key_statuslights_bat_warning, 51.0,
|
handleLevel(R.string.key_statuslights_bat_critical, 26.0,
|
||||||
batteryView, "BAT ", pump.getBatteryLevel());
|
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,
|
void handleAge(String nsSettingPlugin, String eventName, TextView view, String text,
|
||||||
|
|
Loading…
Reference in a new issue