fix glunovo loop

This commit is contained in:
Milos Kozak 2021-11-09 20:22:33 +01:00
parent ffa4120cd5
commit 56d97861e3

View file

@ -94,16 +94,21 @@ class GlunovoPlugin @Inject constructor(
val value = cr.getDouble(1) //value in mmol/l...
if (timestamp > dateUtil.now() || timestamp == 0L) {
aapsLogger.error(LTag.BGSOURCE, "Error in received data date/time $timestamp")
cr.moveToNext()
continue
}
if (value < 2 || value > 25) {
aapsLogger.error(LTag.BGSOURCE, "Error in received data value (value out of bounds) $value")
cr.moveToNext()
continue
}
// bypass already processed
if (timestamp < sp.getLong(R.string.key_last_processed_glunovo_timestamp, 0L)) continue
if (timestamp < sp.getLong(R.string.key_last_processed_glunovo_timestamp, 0L)) {
cr.moveToNext()
continue
}
glucoseValues += CgmSourceTransaction.TransactionGlucoseValue(
timestamp = timestamp,