Move check for running setProfile command to KeepAlive.
This commit is contained in:
parent
014864f0db
commit
a36a9b0746
2 changed files with 2 additions and 5 deletions
|
@ -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() {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue