Merge pull request #2776 from Philoul/AutomationTempTargetMmol

Fix mmol units in automation Temp Target Action
This commit is contained in:
Milos Kozak 2020-06-26 10:59:48 +02:00 committed by GitHub
commit d04cf567b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}