Eopatch: fix pairing

This commit is contained in:
Milos Kozak 2022-11-11 08:31:19 +01:00
parent 7ae9ad1105
commit 9d14db71c7
3 changed files with 69 additions and 75 deletions

View file

@ -82,7 +82,8 @@ public class PatchManager implements IPatchManager {
private Disposable mConnectingDisposable = null;
@Inject
public PatchManager() {}
public PatchManager() {
}
@Inject
void onInit() {
@ -256,24 +257,26 @@ public class PatchManager implements IPatchManager {
public Single<Boolean> patchActivation(long timeout) {
return patchManager.patchActivation(timeout)
.doOnSuccess(success -> {
// if (success) {
// pumpSync.insertTherapyEventIfNewWithTimestamp(
// getPatchConfig().getPatchWakeupTimestamp(),
// DetailedBolusInfo.EventType.CANNULA_CHANGE,
// null,
// null,
// PumpType.EOFLOW_EOPATCH2,
// getPatchConfig().getPatchSerialNumber()
// );
// pumpSync.insertTherapyEventIfNewWithTimestamp(
// getPatchConfig().getPatchWakeupTimestamp(),
// DetailedBolusInfo.EventType.INSULIN_CHANGE,
// null,
// null,
// PumpType.EOFLOW_EOPATCH2,
// getPatchConfig().getPatchSerialNumber()
// );
// }
if (success) {
pumpSync.connectNewPump(true);
Thread.sleep(1000);
pumpSync.insertTherapyEventIfNewWithTimestamp(
System.currentTimeMillis(),
DetailedBolusInfo.EventType.CANNULA_CHANGE,
null,
null,
PumpType.EOFLOW_EOPATCH2,
getPatchConfig().getPatchSerialNumber()
);
pumpSync.insertTherapyEventIfNewWithTimestamp(
System.currentTimeMillis(),
DetailedBolusInfo.EventType.INSULIN_CHANGE,
null,
null,
PumpType.EOFLOW_EOPATCH2,
getPatchConfig().getPatchSerialNumber()
);
}
});
}

View file

@ -382,14 +382,6 @@ public class PatchManagerImpl {
if (success) {
TaskBase.enqueue(TaskFunc.LOW_RESERVOIR);
TaskBase.enqueue(TaskFunc.INFO_REMINDER);
pumpSync.connectNewPump(true);
pumpSync.insertTherapyEventIfNewWithTimestamp(
System.currentTimeMillis(),
DetailedBolusInfo.EventType.INSULIN_CHANGE,
null,
null,
PumpType.EOFLOW_EOPATCH2,
null);
}
});
}

View file

@ -278,7 +278,6 @@ class EopatchActivity : EoBaseActivity<ActivityEopatchBinding>() {
this@EopatchActivity.finish()
}
start()
return
}
}