fix parsin TT - missing duration
This commit is contained in:
parent
64c9196a5c
commit
ec93045d84
1 changed files with 2 additions and 2 deletions
|
@ -419,7 +419,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
||||||
/*
|
/*
|
||||||
* Return last BgReading from database or null if db is empty
|
* Return last BgReading from database or null if db is empty
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@NullablecreateTemptargetFromJsonIfNotExists
|
||||||
public static BgReading lastBg() {
|
public static BgReading lastBg() {
|
||||||
List<BgReading> bgList = IobCobCalculatorPlugin.getPlugin().getBgReadings();
|
List<BgReading> bgList = IobCobCalculatorPlugin.getPlugin().getBgReadings();
|
||||||
|
|
||||||
|
@ -726,7 +726,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
||||||
String units = JsonHelper.safeGetString(trJson, "units", Constants.MGDL);
|
String units = JsonHelper.safeGetString(trJson, "units", Constants.MGDL);
|
||||||
TempTarget tempTarget = new TempTarget()
|
TempTarget tempTarget = new TempTarget()
|
||||||
.date(trJson.getLong("mills"))
|
.date(trJson.getLong("mills"))
|
||||||
.duration(trJson.getInt("duration"))
|
.duration(JsonHelper.safeGetInt(trJson, "duration"))
|
||||||
.low(Profile.toMgdl(trJson.getDouble("targetBottom"), units))
|
.low(Profile.toMgdl(trJson.getDouble("targetBottom"), units))
|
||||||
.high(Profile.toMgdl(trJson.getDouble("targetTop"), units))
|
.high(Profile.toMgdl(trJson.getDouble("targetTop"), units))
|
||||||
.reason(JsonHelper.safeGetString(trJson, "reason", ""))
|
.reason(JsonHelper.safeGetString(trJson, "reason", ""))
|
||||||
|
|
Loading…
Reference in a new issue