- reset riley link fix

This commit is contained in:
Andy Rozman 2020-01-23 23:27:41 +00:00
parent d21339700d
commit 17b61b7ebe
2 changed files with 20 additions and 3 deletions

View file

@ -5,6 +5,10 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.data.
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin;
import info.nightscout.androidaps.plugins.pump.medtronic.events.EventRefreshButtonState;
import info.nightscout.androidaps.plugins.pump.medtronic.service.RileyLinkMedtronicService;
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin;
import info.nightscout.androidaps.plugins.pump.omnipod.service.RileyLinkOmnipodService;
import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodUtil;
/**
* Created by geoff on 7/16/16.
@ -26,9 +30,15 @@ public class ResetRileyLinkConfigurationTask extends PumpTask {
@Override
public void run() {
RxBus.INSTANCE.send(new EventRefreshButtonState(false));
MedtronicPumpPlugin.isBusy = true;
RileyLinkMedtronicService.getInstance().resetRileyLinkConfiguration();
MedtronicPumpPlugin.isBusy = false;
if (MedtronicUtil.isMedtronicPump()) {
MedtronicPumpPlugin.isBusy = true;
RileyLinkMedtronicService.getInstance().resetRileyLinkConfiguration();
MedtronicPumpPlugin.isBusy = false;
} else if (OmnipodUtil.isOmnipodEros()) {
OmnipodPumpPlugin.isBusy = true;
RileyLinkOmnipodService.getInstance().resetRileyLinkConfiguration();
OmnipodPumpPlugin.isBusy = false;
}
RxBus.INSTANCE.send(new EventRefreshButtonState(true));
}

View file

@ -20,10 +20,13 @@ import java.util.List;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.bus.RxBus;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem;
import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin;
import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin;
import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommandType;
import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommunicationManagerInterface;
import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodPodType;
@ -205,4 +208,8 @@ public class OmnipodUtil extends RileyLinkUtil {
public static PodSessionState getPodSessionState() {
return omnipodPumpStatus.podSessionState;
}
public static boolean isOmnipodEros() {
return OmnipodPumpPlugin.getPlugin().isEnabled(PluginType.PUMP);
}
}