Move check for running setProfile command to KeepAlive.

This commit is contained in:
Johannes Mockenhaupt 2018-03-28 22:49:43 +02:00
parent 014864f0db
commit a36a9b0746
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
2 changed files with 2 additions and 5 deletions

View file

@ -651,9 +651,6 @@ public class ConfigBuilderPlugin implements PluginBase, TreatmentsInterface {
@Subscribe
public void onProfileSwitch(EventProfileSwitchChange ignored) {
if (getCommandQueue().isRunning(Command.CommandType.BASALPROFILE))
return;
getCommandQueue().setProfile(getProfile(), new Callback() {
@Override
public void run() {

View file

@ -22,8 +22,8 @@ import info.nightscout.androidaps.events.EventProfileSwitchChange;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.queue.commands.Command;
import info.nightscout.utils.LocalAlertUtils;
import info.nightscout.utils.SP;
public class KeepAliveReceiver extends BroadcastReceiver {
private static Logger log = LoggerFactory.getLogger(KeepAliveReceiver.class);
@ -60,7 +60,7 @@ public class KeepAliveReceiver extends BroadcastReceiver {
LocalAlertUtils.checkPumpUnreachableAlarm(lastConnection, isStatusOutdated);
if (!pump.isThisProfileSet(profile)) {
if (!pump.isThisProfileSet(profile) && !ConfigBuilderPlugin.getCommandQueue().isRunning(Command.CommandType.BASALPROFILE)) {
MainApp.bus().post(new EventProfileSwitchChange());
} else if (isStatusOutdated && !pump.isBusy()) {
ConfigBuilderPlugin.getCommandQueue().readStatus("KeepAlive. Status outdated.", null);