Fix Calibration value in uel.log

This commit is contained in:
Philoul 2021-11-30 20:24:54 +01:00
parent 009d428e89
commit 98ef5768be
3 changed files with 7 additions and 7 deletions

View file

@ -164,11 +164,11 @@ class DexcomPlugin @Inject constructor(
result.calibrationsInserted.forEach { calibration -> result.calibrationsInserted.forEach { calibration ->
calibration.glucose?.let { glucosevalue -> calibration.glucose?.let { glucosevalue ->
uel.log( uel.log(
Action.CAREPORTAL, Action.CALIBRATION,
Sources.Dexcom, Sources.Dexcom,
ValueWithUnit.Timestamp(calibration.timestamp), ValueWithUnit.Timestamp(calibration.timestamp),
ValueWithUnit.TherapyEventType(calibration.type), ValueWithUnit.TherapyEventType(calibration.type),
ValueWithUnit.fromGlucoseUnit(glucosevalue, calibration.glucoseUnit.toString()) ValueWithUnit.fromGlucoseUnit(glucosevalue, calibration.glucoseUnit.toString)
) )
} }
aapsLogger.debug(LTag.DATABASE, "Inserted calibration $calibration") aapsLogger.debug(LTag.DATABASE, "Inserted calibration $calibration")

View file

@ -153,11 +153,11 @@ class GlunovoPlugin @Inject constructor(
savedValues.calibrationsInserted.forEach { calibration -> savedValues.calibrationsInserted.forEach { calibration ->
calibration.glucose?.let { glucosevalue -> calibration.glucose?.let { glucosevalue ->
uel.log( uel.log(
UserEntry.Action.CAREPORTAL, UserEntry.Action.CALIBRATION,
UserEntry.Sources.Dexcom, UserEntry.Sources.Dexcom,
ValueWithUnit.Timestamp(calibration.timestamp), ValueWithUnit.Timestamp(calibration.timestamp),
ValueWithUnit.TherapyEventType(calibration.type), ValueWithUnit.TherapyEventType(calibration.type),
ValueWithUnit.fromGlucoseUnit(glucosevalue, calibration.glucoseUnit.toString()) ValueWithUnit.fromGlucoseUnit(glucosevalue, calibration.glucoseUnit.toString)
) )
} }
aapsLogger.debug(LTag.DATABASE, "Inserted calibration $calibration") aapsLogger.debug(LTag.DATABASE, "Inserted calibration $calibration")

View file

@ -66,9 +66,9 @@ data class TherapyEvent(
previous.interfaceIDs.nightscoutId == null && previous.interfaceIDs.nightscoutId == null &&
interfaceIDs.nightscoutId != null interfaceIDs.nightscoutId != null
enum class GlucoseUnit { enum class GlucoseUnit (val toString: String) {
MGDL, MGDL (ValueWithUnit.MGDL),
MMOL; MMOL (ValueWithUnit.MMOL);
companion object companion object
} }