call connectNewPump() in NSClient mode
This commit is contained in:
parent
04de964e97
commit
aa58b37643
|
@ -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,10 +97,13 @@ 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)
|
||||||
|
if (sp.getString(R.string.key_virtualpump_type, "fake") != pumpType) {
|
||||||
sp.putString(R.string.key_virtualpump_type, pumpType)
|
sp.putString(R.string.key_virtualpump_type, pumpType)
|
||||||
activePlugin.activePump.pumpDescription.fillFor(PumpType.getByDescription(pumpType))
|
activePlugin.activePump.pumpDescription.fillFor(PumpType.getByDescription(pumpType))
|
||||||
|
pumpSync.connectNewPump()
|
||||||
aapsLogger.debug(LTag.CORE, "Changing pump type to $pumpType")
|
aapsLogger.debug(LTag.CORE, "Changing pump type to $pumpType")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (configuration.has("overviewConfiguration"))
|
if (configuration.has("overviewConfiguration"))
|
||||||
activePlugin.activeOverview.applyConfiguration(configuration.getJSONObject("overviewConfiguration"))
|
activePlugin.activeOverview.applyConfiguration(configuration.getJSONObject("overviewConfiguration"))
|
||||||
|
|
Loading…
Reference in a new issue