Merge branch 'omnipod_eros_dev' into make_3_x_rl_versions_work
This commit is contained in:
commit
285dbf1cbc
10 changed files with 21 additions and 15 deletions
|
@ -338,7 +338,7 @@ public class ComboPlugin extends PumpPluginBase implements PumpInterface, Constr
|
|||
* Runs pump initialization if needed and reads the pump state from the main screen.
|
||||
*/
|
||||
@Override
|
||||
public synchronized void getPumpStatus() {
|
||||
public synchronized void getPumpStatus(String reason) {
|
||||
getAapsLogger().debug(LTag.PUMP, "getPumpStatus called");
|
||||
if (!pump.initialized) {
|
||||
initializePump();
|
||||
|
|
|
@ -370,7 +370,7 @@ public class LocalInsightPlugin extends PumpPluginBase implements PumpInterface,
|
|||
}
|
||||
|
||||
@Override
|
||||
public void getPumpStatus() {
|
||||
public void getPumpStatus(String reason) {
|
||||
try {
|
||||
tbrOverNotificationBlock = ParameterBlockUtil.readParameterBlock(connectionService, Service.CONFIGURATION, TBROverNotificationBlock.class);
|
||||
readHistory();
|
||||
|
|
|
@ -132,7 +132,7 @@ public class MDIPlugin extends PumpPluginBase implements PumpInterface {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void getPumpStatus() {
|
||||
public void getPumpStatus(String reason) {
|
||||
}
|
||||
|
||||
@NonNull @Override
|
||||
|
|
|
@ -178,7 +178,7 @@ class VirtualPumpPlugin @Inject constructor(
|
|||
|
||||
override fun disconnect(reason: String) {}
|
||||
override fun stopConnecting() {}
|
||||
override fun getPumpStatus() {
|
||||
override fun getPumpStatus(reason: String?) {
|
||||
lastDataTime = System.currentTimeMillis()
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import javax.inject.Inject
|
|||
|
||||
class CommandReadStatus(
|
||||
injector: HasAndroidInjector,
|
||||
private val reason: String,
|
||||
val reason: String,
|
||||
callback: Callback?
|
||||
) : Command(injector, CommandType.READSTATUS, callback) {
|
||||
|
||||
|
@ -19,7 +19,7 @@ class CommandReadStatus(
|
|||
@Inject lateinit var localAlertUtils: LocalAlertUtils
|
||||
|
||||
override fun execute() {
|
||||
activePlugin.activePump.getPumpStatus()
|
||||
activePlugin.activePump.getPumpStatus(reason)
|
||||
localAlertUtils.notifyPumpStatusRead()
|
||||
aapsLogger.debug(LTag.PUMPQUEUE, "CommandReadStatus executed. Reason: $reason")
|
||||
val pump = activePlugin.activePump
|
||||
|
|
|
@ -43,7 +43,7 @@ public interface PumpInterface {
|
|||
|
||||
void stopConnecting();
|
||||
|
||||
void getPumpStatus();
|
||||
void getPumpStatus(String reason);
|
||||
|
||||
// Upload to pump new basal profile
|
||||
@NotNull
|
||||
|
|
|
@ -361,7 +361,7 @@ public abstract class AbstractDanaRPlugin extends PumpPluginBase implements Pump
|
|||
}
|
||||
|
||||
@Override
|
||||
public void getPumpStatus() {
|
||||
public void getPumpStatus(String reason) {
|
||||
if (sExecutionService != null) {
|
||||
sExecutionService.getPumpStatus();
|
||||
pumpDescription.basalStep = danaPump.getBasalStep();
|
||||
|
|
|
@ -165,7 +165,7 @@ class DanaRSPlugin @Inject constructor(
|
|||
danaRSService?.stopConnecting()
|
||||
}
|
||||
|
||||
override fun getPumpStatus() {
|
||||
override fun getPumpStatus(reason: String?) {
|
||||
danaRSService?.readPumpStatus()
|
||||
pumpDesc.basalStep = danaPump.basalStep
|
||||
pumpDesc.bolusStep = danaPump.bolusStep
|
||||
|
|
|
@ -421,7 +421,7 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
|
|||
|
||||
|
||||
@Override
|
||||
public void getPumpStatus() {
|
||||
public void getPumpStatus(String reason) {
|
||||
|
||||
if (firstRun) {
|
||||
initializePump(!isRefresh);
|
||||
|
|
|
@ -537,20 +537,26 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
|
|||
|
||||
/**
|
||||
* We don't do periodical status requests because that could drain the Pod's battery
|
||||
* The only actual status requests we send to the Pod here are on startup (in {@link #initializeAfterRileyLinkConnection() initializeAfterRileyLinkConnection()})
|
||||
* The only actual status requests we send to the Pod here are on startup (in {@link #initializeAfterRileyLinkConnection() initializeAfterRileyLinkConnection()}),
|
||||
* When explicitly requested through SMS commands
|
||||
* And when the basal and/or temp basal status is uncertain
|
||||
* When the user explicitly requested it by clicking the Refresh button on the Omnipod tab (which is executed through {@link #executeCustomCommand(CustomCommand)})
|
||||
*/
|
||||
@Override
|
||||
public void getPumpStatus() {
|
||||
public void getPumpStatus(String reason) {
|
||||
if (firstRun) {
|
||||
initializeAfterRileyLinkConnection();
|
||||
firstRun = false;
|
||||
} else {
|
||||
if ("SMS".equals(reason)) {
|
||||
aapsLogger.info(LTag.PUMP, "Acknowledged AAPS getPumpStatus request it was requested through an SMS");
|
||||
getPodStatus();
|
||||
} else if (!podStateManager.isBasalCertain() || !podStateManager.isTempBasalCertain()) {
|
||||
aapsLogger.info(LTag.PUMP, "Acknowledged AAPS getPumpStatus request because basal and/or temp basal is uncertain");
|
||||
getPodStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private PumpEnactResult getPodStatus() {
|
||||
return executeCommand(OmnipodCommandType.GET_POD_STATUS, aapsOmnipodManager::getPodStatus);
|
||||
|
|
Loading…
Reference in a new issue