Skip fetching initial pump state if ruffy service isn't ready yet.

This commit is contained in:
Johannes Mockenhaupt 2017-07-18 18:25:59 +02:00
parent f3b508ba2d
commit 14d7043600
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -296,6 +296,12 @@ public class ComboPlugin implements PluginBase, PumpInterface {
public void refreshDataFromPump(String reason) {
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")
&& lastCmdTime.getTime() > 0
&& System.currentTimeMillis() > lastCmdTime.getTime() + 60 * 1000) {