Fix Insight DST pump time update
This commit is contained in:
parent
4b86a07eac
commit
3894e44cc7
1 changed files with 1 additions and 1 deletions
|
@ -315,7 +315,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
|
||||||
calendar.set(Calendar.HOUR_OF_DAY, pumpTime.getHour());
|
calendar.set(Calendar.HOUR_OF_DAY, pumpTime.getHour());
|
||||||
calendar.set(Calendar.MINUTE, pumpTime.getMinute());
|
calendar.set(Calendar.MINUTE, pumpTime.getMinute());
|
||||||
calendar.set(Calendar.SECOND, pumpTime.getSecond());
|
calendar.set(Calendar.SECOND, pumpTime.getSecond());
|
||||||
if (Math.abs(calendar.getTimeInMillis() - System.currentTimeMillis()) > 10000) {
|
if (calendar.get(Calendar.HOUR_OF_DAY) != pumpTime.getHour() || Math.abs(calendar.getTimeInMillis() - System.currentTimeMillis()) > 10000) {
|
||||||
calendar.setTime(new Date());
|
calendar.setTime(new Date());
|
||||||
pumpTime.setYear(calendar.get(Calendar.YEAR));
|
pumpTime.setYear(calendar.get(Calendar.YEAR));
|
||||||
pumpTime.setMonth(calendar.get(Calendar.MONTH) + 1);
|
pumpTime.setMonth(calendar.get(Calendar.MONTH) + 1);
|
||||||
|
|
Loading…
Reference in a new issue