NSC: hide virtual pump

This commit is contained in:
Milos Kozak 2021-10-26 12:54:51 +02:00
parent 8efa66f23d
commit 15c166586f

View file

@ -51,7 +51,8 @@ open class VirtualPumpPlugin @Inject constructor(
private val pumpSync: PumpSync,
private val config: Config,
private val dateUtil: DateUtil
) : PumpPluginBase(PluginDescription()
) : PumpPluginBase(
PluginDescription()
.mainType(PluginType.PUMP)
.fragmentClass(VirtualPumpFragment::class.java.name)
.pluginIcon(R.drawable.ic_virtual_pump)
@ -59,7 +60,8 @@ open class VirtualPumpPlugin @Inject constructor(
.shortName(R.string.virtualpump_shortname)
.preferencesId(R.xml.pref_virtualpump)
.description(R.string.description_pump_virtual)
.setDefault(),
.setDefault()
.neverVisible(config.NSCLIENT),
injector, aapsLogger, resourceHelper, commandQueue
), Pump {
@ -203,14 +205,16 @@ open class VirtualPumpPlugin @Inject constructor(
type = detailedBolusInfo.bolusType,
pumpId = dateUtil.now(),
pumpType = pumpType ?: PumpType.GENERIC_AAPS,
pumpSerial = serialNumber())
pumpSerial = serialNumber()
)
if (detailedBolusInfo.carbs > 0)
pumpSync.syncCarbsWithTimestamp(
timestamp = detailedBolusInfo.carbsTimestamp ?: detailedBolusInfo.timestamp,
amount = detailedBolusInfo.carbs,
pumpId = null,
pumpType = pumpType ?: PumpType.GENERIC_AAPS,
pumpSerial = serialNumber())
pumpSerial = serialNumber()
)
return result
}