recheck pump status if older than 30 min before aplly basal

This commit is contained in:
Milos Kozak 2016-09-11 13:32:21 +02:00
parent 81e82143fc
commit 841141cd20

View file

@ -272,6 +272,11 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
// This is called from APS
@Override
public PumpEnactResult setTempBasalAbsolute(Double absoluteRate, Integer durationInMinutes) {
// Recheck pump status if older than 30 min
if (getDanaRPump().lastConnection.getTime() + 30 * 60 * 1000L < new Date().getTime()) {
doConnect("setTempBasalAbsolute old data");
}
PumpEnactResult result = new PumpEnactResult();
ConfigBuilderPlugin configBuilderPlugin = MainApp.getConfigBuilder();