Fix Units mmol in Automation (internal unit in AAPS is mgdl)
This commit is contained in:
parent
90e2c8f65f
commit
f6ecf8a5df
|
@ -71,7 +71,7 @@ class ActionCarePortalEvent(injector: HasAndroidInjector) : Action(injector) {
|
||||||
if (glucoseStatus != null) {
|
if (glucoseStatus != null) {
|
||||||
therapyEvent.glucose = glucoseStatus.glucose
|
therapyEvent.glucose = glucoseStatus.glucose
|
||||||
therapyEvent.glucoseType = TherapyEvent.MeterType.SENSOR
|
therapyEvent.glucoseType = TherapyEvent.MeterType.SENSOR
|
||||||
valuesWithUnit.add(ValueWithUnit.fromGlucoseUnit(glucoseStatus.glucose, profileFunction.getUnits().asText))
|
valuesWithUnit.add(ValueWithUnit.Mgdl(glucoseStatus.glucose))
|
||||||
valuesWithUnit.add(ValueWithUnit.TherapyEventMeterType(TherapyEvent.MeterType.SENSOR))
|
valuesWithUnit.add(ValueWithUnit.TherapyEventMeterType(TherapyEvent.MeterType.SENSOR))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -63,8 +63,8 @@ class ActionStartTempTarget(injector: HasAndroidInjector) : Action(injector) {
|
||||||
result.updated.forEach { aapsLogger.debug(LTag.DATABASE, "Updated temp target $it") }
|
result.updated.forEach { aapsLogger.debug(LTag.DATABASE, "Updated temp target $it") }
|
||||||
uel.log(UserEntry.Action.TT, Sources.Automation, title,
|
uel.log(UserEntry.Action.TT, Sources.Automation, title,
|
||||||
ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.AUTOMATION),
|
ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.AUTOMATION),
|
||||||
ValueWithUnit.fromGlucoseUnit(tt().lowTarget, value.units.asText),
|
ValueWithUnit.Mgdl(tt().lowTarget),
|
||||||
ValueWithUnit.fromGlucoseUnit(tt().highTarget, value.units.asText).takeIf { tt().lowTarget != tt().highTarget },
|
ValueWithUnit.Mgdl(tt().highTarget).takeIf { tt().lowTarget != tt().highTarget },
|
||||||
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt().duration).toInt()))
|
ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt().duration).toInt()))
|
||||||
callback.result(PumpEnactResult(injector).success(true).comment(R.string.ok))?.run()
|
callback.result(PumpEnactResult(injector).success(true).comment(R.string.ok))?.run()
|
||||||
}, {
|
}, {
|
||||||
|
|
Loading…
Reference in a new issue