Merge pull request #2776 from Philoul/AutomationTempTargetMmol
Fix mmol units in automation Temp Target Action
This commit is contained in:
commit
d04cf567b8
1 changed files with 4 additions and 0 deletions
|
@ -4,14 +4,18 @@ import android.widget.LinearLayout
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.Constants
|
import info.nightscout.androidaps.Constants
|
||||||
import info.nightscout.androidaps.R
|
import info.nightscout.androidaps.R
|
||||||
|
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||||
import info.nightscout.androidaps.utils.NumberPicker
|
import info.nightscout.androidaps.utils.NumberPicker
|
||||||
import java.text.DecimalFormat
|
import java.text.DecimalFormat
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
class InputTempTarget(injector: HasAndroidInjector) : Element(injector) {
|
class InputTempTarget(injector: HasAndroidInjector) : Element(injector) {
|
||||||
var units = Constants.MGDL
|
var units = Constants.MGDL
|
||||||
var value = 0.0
|
var value = 0.0
|
||||||
|
@Inject lateinit var profileFunction: ProfileFunction
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
units = profileFunction.getUnits()
|
||||||
value = if (units == Constants.MMOL) 6.0 else 110.0
|
value = if (units == Constants.MMOL) 6.0 else 110.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue