Minor cleanups in ComboPlugin.

This commit is contained in:
Johannes Mockenhaupt 2017-12-06 17:12:29 +01:00
parent b0d55b09d4
commit de06c54f1d
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -327,7 +327,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
*/ */
@Override @Override
public synchronized void getPumpStatus() { public synchronized void getPumpStatus() {
log.debug("RefreshDataFromPump called"); log.debug("getPumpStatus called");
if (!pump.initialized) { if (!pump.initialized) {
long maxWait = System.currentTimeMillis() + 15 * 1000; long maxWait = System.currentTimeMillis() + 15 * 1000;
while (!ruffyScripter.isPumpAvailable()) { while (!ruffyScripter.isPumpAvailable()) {
@ -636,6 +636,8 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
return new PumpEnactResult().success(true).enacted(false); return new PumpEnactResult().success(true).enacted(false);
} else if ((activeTemp.percentRate >= 90 && activeTemp.percentRate <= 110) && activeTemp.getPlannedRemainingMinutes() <= 15) { } else if ((activeTemp.percentRate >= 90 && activeTemp.percentRate <= 110) && activeTemp.getPlannedRemainingMinutes() <= 15) {
// Let fake neutral temp keep run (see below) // Let fake neutral temp keep run (see below)
// Note that a connection to the pump is still opened, since the queue issues a getPumpStatus() call whenever an empty
// queue receives a new command. Probably not worth optimizing.
log.debug("cancelTempBasal: skipping changing tbr since it already is at " + activeTemp.percentRate + "% and running for another " + activeTemp.getPlannedRemainingMinutes() + " mins."); log.debug("cancelTempBasal: skipping changing tbr since it already is at " + activeTemp.percentRate + "% and running for another " + activeTemp.getPlannedRemainingMinutes() + " mins.");
return new PumpEnactResult().success(true).enacted(true) return new PumpEnactResult().success(true).enacted(true)
.comment("cancelTempBasal skipping changing tbr since it already is at " .comment("cancelTempBasal skipping changing tbr since it already is at "