Merge remote-tracking branch 'origin/dev' into combo-scripter-v2
* origin/dev: missing return log profiles if different fix setting of TRB when low basal rate is running fix format and add test for fromISODateString use mills from status if available
This commit is contained in:
commit
bf52352224
|
@ -409,9 +409,14 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isThisProfileSet(Profile profile) {
|
public boolean isThisProfileSet(Profile profile) {
|
||||||
if (activePump != null)
|
if (activePump != null) {
|
||||||
return activePump.isThisProfileSet(profile);
|
boolean result = activePump.isThisProfileSet(profile);
|
||||||
else return true;
|
if (result == false) {
|
||||||
|
log.debug("Current profile: " + getProfile().getData().toString());
|
||||||
|
log.debug("New profile: " + profile.getData().toString());
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
} else return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -564,7 +569,7 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
|
||||||
|
|
||||||
if (Config.logCongigBuilderActions)
|
if (Config.logCongigBuilderActions)
|
||||||
log.debug("applyAPSRequest: " + request.toString());
|
log.debug("applyAPSRequest: " + request.toString());
|
||||||
if ((request.rate == 0 && request.duration == 0) || Math.abs(request.rate - getBaseBasalRate()) < 0.05) {
|
if ((request.rate == 0 && request.duration == 0) || Math.abs(request.rate - getBaseBasalRate()) < getPumpDescription().basalStep) {
|
||||||
if (isTempBasalInProgress()) {
|
if (isTempBasalInProgress()) {
|
||||||
if (Config.logCongigBuilderActions)
|
if (Config.logCongigBuilderActions)
|
||||||
log.debug("applyAPSRequest: cancelTempBasal()");
|
log.debug("applyAPSRequest: cancelTempBasal()");
|
||||||
|
|
|
@ -336,7 +336,9 @@ public class NSDeviceStatus {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
long clock = 0L;
|
long clock = 0L;
|
||||||
if (object.has("created_at"))
|
if (object.has("mills"))
|
||||||
|
clock = object.getLong("mills");
|
||||||
|
else if (object.has("created_at"))
|
||||||
clock = DateUtil.fromISODateString(object.getString("created_at")).getTime();
|
clock = DateUtil.fromISODateString(object.getString("created_at")).getTime();
|
||||||
String device = getDevice();
|
String device = getDevice();
|
||||||
Integer battery = null;
|
Integer battery = null;
|
||||||
|
|
|
@ -27,8 +27,8 @@ public class DateUtil {
|
||||||
/**
|
/**
|
||||||
* The date format in iso.
|
* The date format in iso.
|
||||||
*/
|
*/
|
||||||
private static String FORMAT_DATE_ISO = "yyyy-MM-dd'T'HH:mm:ss'Z'";
|
private static String FORMAT_DATE_ISO = "yyyy-MM-dd'T'HH:mm:ssZ";
|
||||||
private static String FORMAT_DATE_ISO_MSEC = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
|
private static String FORMAT_DATE_ISO_MSEC = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Takes in an ISO date string of the following format:
|
* Takes in an ISO date string of the following format:
|
||||||
|
|
25
app/src/test/java/info/nightscout/utils/DateUtilTest.java
Normal file
25
app/src/test/java/info/nightscout/utils/DateUtilTest.java
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
package info.nightscout.utils;
|
||||||
|
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by mike on 20.11.2017.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class DateUtilTest {
|
||||||
|
|
||||||
|
public DateUtilTest() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void fromISODateStringTest() throws Exception {
|
||||||
|
assertEquals( 1511124634417L, DateUtil.fromISODateString("2017-11-19T22:50:34.417+0200").getTime());
|
||||||
|
assertEquals( 1511124634000L, DateUtil.fromISODateString("2017-11-19T22:50:34+0200").getTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue