Skip fetching initial pump state if ruffy service isn't ready yet.
This commit is contained in:
parent
f3b508ba2d
commit
14d7043600
|
@ -296,6 +296,12 @@ public class ComboPlugin implements PluginBase, PumpInterface {
|
||||||
public void refreshDataFromPump(String reason) {
|
public void refreshDataFromPump(String reason) {
|
||||||
log.debug("RefreshDataFromPump called");
|
log.debug("RefreshDataFromPump called");
|
||||||
|
|
||||||
|
// if Android is sluggish this might get called before ruffy is bound
|
||||||
|
if (ruffyScripter == null) {
|
||||||
|
log.debug("Rejecting call to RefreshDataFromPump: ruffy service not bound yet");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!reason.toLowerCase().contains("user")
|
if (!reason.toLowerCase().contains("user")
|
||||||
&& lastCmdTime.getTime() > 0
|
&& lastCmdTime.getTime() > 0
|
||||||
&& System.currentTimeMillis() > lastCmdTime.getTime() + 60 * 1000) {
|
&& System.currentTimeMillis() > lastCmdTime.getTime() + 60 * 1000) {
|
||||||
|
|
Loading…
Reference in a new issue