add delay to sms bolus command
This commit is contained in:
parent
15607dc9be
commit
ee2d6b71d1
1 changed files with 4 additions and 0 deletions
|
@ -2,6 +2,7 @@ package info.nightscout.androidaps.plugins.SmsCommunicator;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
|
import android.os.SystemClock;
|
||||||
import android.telephony.SmsManager;
|
import android.telephony.SmsManager;
|
||||||
import android.telephony.SmsMessage;
|
import android.telephony.SmsMessage;
|
||||||
|
|
||||||
|
@ -47,6 +48,7 @@ import info.nightscout.utils.FabricPrivacy;
|
||||||
import info.nightscout.utils.NSUpload;
|
import info.nightscout.utils.NSUpload;
|
||||||
import info.nightscout.utils.SP;
|
import info.nightscout.utils.SP;
|
||||||
import info.nightscout.utils.SafeParse;
|
import info.nightscout.utils.SafeParse;
|
||||||
|
import info.nightscout.utils.T;
|
||||||
import info.nightscout.utils.XdripCalibrations;
|
import info.nightscout.utils.XdripCalibrations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -450,12 +452,14 @@ public class SmsCommunicatorPlugin extends PluginBase {
|
||||||
public void run() {
|
public void run() {
|
||||||
PumpInterface pump = MainApp.getConfigBuilder().getActivePump();
|
PumpInterface pump = MainApp.getConfigBuilder().getActivePump();
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
|
SystemClock.sleep(T.secs(15).msecs()); // wait some time to get history
|
||||||
String reply = String.format(MainApp.gs(R.string.smscommunicator_bolusdelivered), result.bolusDelivered);
|
String reply = String.format(MainApp.gs(R.string.smscommunicator_bolusdelivered), result.bolusDelivered);
|
||||||
if (pump != null)
|
if (pump != null)
|
||||||
reply += "\n" + pump.shortStatus(true);
|
reply += "\n" + pump.shortStatus(true);
|
||||||
lastRemoteBolusTime = new Date();
|
lastRemoteBolusTime = new Date();
|
||||||
sendSMSToAllNumbers(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
sendSMSToAllNumbers(new Sms(receivedSms.phoneNumber, reply, new Date()));
|
||||||
} else {
|
} else {
|
||||||
|
SystemClock.sleep(T.secs(60).msecs()); // wait some time to get history
|
||||||
String reply = MainApp.gs(R.string.smscommunicator_bolusfailed);
|
String reply = MainApp.gs(R.string.smscommunicator_bolusfailed);
|
||||||
if (pump != null)
|
if (pump != null)
|
||||||
reply += "\n" + pump.shortStatus(true);
|
reply += "\n" + pump.shortStatus(true);
|
||||||
|
|
Loading…
Reference in a new issue