diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputTempTarget.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputTempTarget.kt index fa1939e951..8208e7e687 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputTempTarget.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputTempTarget.kt @@ -4,14 +4,18 @@ import android.widget.LinearLayout import dagger.android.HasAndroidInjector import info.nightscout.androidaps.Constants import info.nightscout.androidaps.R +import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.NumberPicker import java.text.DecimalFormat +import javax.inject.Inject class InputTempTarget(injector: HasAndroidInjector) : Element(injector) { var units = Constants.MGDL var value = 0.0 + @Inject lateinit var profileFunction: ProfileFunction init { + units = profileFunction.getUnits() value = if (units == Constants.MMOL) 6.0 else 110.0 }