Rv2,RS fix loading events

This commit is contained in:
Milos Kozak 2017-12-21 07:45:56 +01:00
parent adff0329dd
commit 2bdda9af43
2 changed files with 8 additions and 2 deletions

View file

@ -185,7 +185,10 @@ public class DanaRSService extends Service {
while (!msg.done && bleComm.isConnected()) {
SystemClock.sleep(100);
}
lastHistoryFetched = DanaRS_Packet_APS_History_Events.lastEventTimeLoaded - 45 * 60 * 1000L; // always load last 45 min
if (DanaRS_Packet_APS_History_Events.lastEventTimeLoaded != 0)
lastHistoryFetched = DanaRS_Packet_APS_History_Events.lastEventTimeLoaded - 45 * 60 * 1000L; // always load last 45 min
else
lastHistoryFetched = 0;
log.debug("Events loaded");
return new PumpEnactResult().success(true);
}

View file

@ -527,7 +527,10 @@ public class DanaRv2ExecutionService extends Service {
waitMsec(100);
}
waitMsec(200);
lastHistoryFetched = MsgHistoryEvents_v2.lastEventTimeLoaded - 45 * 60 * 1000L; //always load last 45 min;
if (MsgHistoryEvents_v2.lastEventTimeLoaded != 0)
lastHistoryFetched = MsgHistoryEvents_v2.lastEventTimeLoaded - 45 * 60 * 1000L; //always load last 45 min;
else
lastHistoryFetched = 0;
return new PumpEnactResult().success(true);
}