NSClient: fix json parsing
This commit is contained in:
parent
b0736b5246
commit
5aa1d988b1
|
@ -66,19 +66,11 @@ fun temporaryTargetFromJson(jsonObject: JSONObject): TemporaryTarget? {
|
|||
|
||||
if (duration > 0L) {
|
||||
// not ending event
|
||||
if (units == GlucoseUnit.MMOL) {
|
||||
if (low < Constants.MIN_TT_MMOL) return null
|
||||
if (low > Constants.MAX_TT_MMOL) return null
|
||||
if (high < Constants.MIN_TT_MMOL) return null
|
||||
if (high > Constants.MAX_TT_MMOL) return null
|
||||
if (low > high) return null
|
||||
} else {
|
||||
if (low < Constants.MIN_TT_MGDL) return null
|
||||
if (low > Constants.MAX_TT_MGDL) return null
|
||||
if (high < Constants.MIN_TT_MGDL) return null
|
||||
if (high > Constants.MAX_TT_MGDL) return null
|
||||
if (low > high) return null
|
||||
}
|
||||
if (low < Constants.MIN_TT_MGDL) return null
|
||||
if (low > Constants.MAX_TT_MGDL) return null
|
||||
if (high < Constants.MIN_TT_MGDL) return null
|
||||
if (high > Constants.MAX_TT_MGDL) return null
|
||||
if (low > high) return null
|
||||
}
|
||||
val tt = TemporaryTarget(
|
||||
timestamp = timestamp,
|
||||
|
|
Loading…
Reference in a new issue