Set an error state when the ruffy service can't be bound.
See code comment.
This commit is contained in:
parent
02a9ed6eda
commit
487e9deb88
|
@ -187,7 +187,14 @@ public class ComboPlugin implements PluginBase, PumpInterface {
|
||||||
pumpDescription.basalStep = 0.01d;
|
pumpDescription.basalStep = 0.01d;
|
||||||
pumpDescription.basalMinimumRate = 0.0d;
|
pumpDescription.basalMinimumRate = 0.0d;
|
||||||
|
|
||||||
pumpDescription.isRefillingCapable = false;
|
boolean success = context.bindService(intent, mRuffyServiceConnection, Context.BIND_AUTO_CREATE);
|
||||||
|
if (!success) {
|
||||||
|
log.error("Binding to ruffy service failed");
|
||||||
|
// AAPS will still crash since it continues trying to access the pump, even when isInitalized
|
||||||
|
// returns false and isBusy returns true; this will however not crash the alerter
|
||||||
|
// which will raise an exception. Not really ideal.
|
||||||
|
pumpState.errorMsg = "Failed to bind to ruffy service";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -363,7 +370,7 @@ public class ComboPlugin implements PluginBase, PumpInterface {
|
||||||
lastCmd = command;
|
lastCmd = command;
|
||||||
lastCmdTime = new Date();
|
lastCmdTime = new Date();
|
||||||
if (commandResult.success) {
|
if (commandResult.success) {
|
||||||
statusSummary = "Idle";
|
statusSummary = commandResult.state.suspended ? "Suspended" : "Idle";
|
||||||
pumpState = commandResult.state;
|
pumpState = commandResult.state;
|
||||||
} else {
|
} else {
|
||||||
statusSummary = "Error";
|
statusSummary = "Error";
|
||||||
|
|
Loading…
Reference in a new issue