maybe better error recovery?

This commit is contained in:
Sandra Keßler 2017-07-31 12:59:03 +02:00
parent 58e6791441
commit 14fdc14807

View file

@ -158,6 +158,7 @@ public class ComboPlugin implements PluginBase, PumpInterface {
lastAlarmTime = now; lastAlarmTime = now;
} else { } else {
log.warn("Pump still in error state, but alarm raised recently, so not triggering again: " + localLastCmdResult.message); log.warn("Pump still in error state, but alarm raised recently, so not triggering again: " + localLastCmdResult.message);
refreshDataFromPump("from Error Recovery");
} }
} }
SystemClock.sleep(5 * 1000); SystemClock.sleep(5 * 1000);
@ -166,7 +167,13 @@ public class ComboPlugin implements PluginBase, PumpInterface {
}, "combo-alerter").start(); }, "combo-alerter").start();
} }
private void bindRuffyService() { private boolean bindRuffyService() {
if(ruffyScripter != null)
{
log.debug("ruffy service already connected!");
return false;
}
Context context = MainApp.instance().getApplicationContext(); Context context = MainApp.instance().getApplicationContext();
boolean boundSucceeded = false; boolean boundSucceeded = false;
@ -207,6 +214,7 @@ public class ComboPlugin implements PluginBase, PumpInterface {
if (!boundSucceeded) { if (!boundSucceeded) {
statusSummary = "No connection to ruffy. Pump control not available."; statusSummary = "No connection to ruffy. Pump control not available.";
} }
return true;
} }
private void unbindRuffyService() { private void unbindRuffyService() {