From 4b1a7745447b6a2aee80a5ecd713ccd93bec0628 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Tue, 21 Nov 2017 00:43:17 +0100 Subject: [PATCH] Optimize fetching full history. --- .../androidaps/plugins/PumpCombo/ComboPlugin.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java index 11975cdde8..1f8e7d38ff 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java @@ -940,10 +940,10 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf void readAllPumpData() { readHistory(new PumpHistoryRequest() - .bolusHistory(PumpHistoryRequest.FULL) - .tbrHistory(PumpHistoryRequest.FULL) - .pumpErrorHistory(PumpHistoryRequest.FULL) - .tddHistory(PumpHistoryRequest.FULL)); + .bolusHistory(pump.history.bolusHistory.isEmpty() ? PumpHistoryRequest.FULL : pump.history.bolusHistory.get(0).timestamp) + .tbrHistory(pump.history.tbrHistory.isEmpty() ? PumpHistoryRequest.FULL : pump.history.tbrHistory.get(0).timestamp) + .pumpErrorHistory(pump.history.pumpErrorHistory.isEmpty() ? PumpHistoryRequest.FULL : pump.history.pumpErrorHistory.get(0).timestamp) + .tddHistory(pump.history.tddHistory.isEmpty() ? PumpHistoryRequest.FULL : pump.history.tddHistory.get(0).timestamp)); CommandResult commandResult = runCommand("Reading basal profile", 2, ruffyScripter::readBasalProfile); if (commandResult.success) {