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