call connectNewPump() in NSClient mode

This commit is contained in:
Milos Kozak 2021-11-09 18:13:41 +01:00
parent 04de964e97
commit aa58b37643

View file

@ -25,7 +25,8 @@ class RunningConfiguration @Inject constructor(
private val aapsLogger: AAPSLogger, private val aapsLogger: AAPSLogger,
private val config: Config, private val config: Config,
private val rh: ResourceHelper, private val rh: ResourceHelper,
private val rxBus: RxBus private val rxBus: RxBus,
private val pumpSync: PumpSync
) { ) {
private var counter = 0 private var counter = 0
@ -96,9 +97,12 @@ class RunningConfiguration @Inject constructor(
if (configuration.has("pump")) { if (configuration.has("pump")) {
val pumpType = JsonHelper.safeGetString(configuration, "pump", PumpType.GENERIC_AAPS.description) val pumpType = JsonHelper.safeGetString(configuration, "pump", PumpType.GENERIC_AAPS.description)
sp.putString(R.string.key_virtualpump_type, pumpType) if (sp.getString(R.string.key_virtualpump_type, "fake") != pumpType) {
activePlugin.activePump.pumpDescription.fillFor(PumpType.getByDescription(pumpType)) sp.putString(R.string.key_virtualpump_type, pumpType)
aapsLogger.debug(LTag.CORE, "Changing pump type to $pumpType") activePlugin.activePump.pumpDescription.fillFor(PumpType.getByDescription(pumpType))
pumpSync.connectNewPump()
aapsLogger.debug(LTag.CORE, "Changing pump type to $pumpType")
}
} }
if (configuration.has("overviewConfiguration")) if (configuration.has("overviewConfiguration"))