block if no profile switch is set
This commit is contained in:
parent
d155616c0b
commit
59a1e007ad
1 changed files with 11 additions and 0 deletions
|
@ -287,6 +287,17 @@ public class CommandQueue {
|
|||
return false;
|
||||
}
|
||||
|
||||
// Check that there is a valid profileSwitch NOW
|
||||
if (MainApp.getConfigBuilder().getProfileSwitchFromHistory(System.currentTimeMillis())==null) {
|
||||
Notification noProfileSwitchNotif = new Notification(Notification.PROFILE_SWITCH_MISSING, MainApp.sResources.getString(R.string.profileswitch_missing), Notification.NORMAL);
|
||||
MainApp.bus().post(new EventNewNotification(noProfileSwitchNotif));
|
||||
if (callback != null) {
|
||||
PumpEnactResult result = new PumpEnactResult().success(false).enacted(false).comment("Refuse to send profile to pump! No ProfileSwitch!");
|
||||
callback.result(result).run();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Compare with pump limits
|
||||
Profile.BasalValue[] basalValues = profile.getBasalValues();
|
||||
PumpInterface pump = ConfigBuilderPlugin.getActivePump();
|
||||
|
|
Loading…
Reference in a new issue