Some more TBR certainty improvements
This commit is contained in:
parent
084c8fd02f
commit
3daff2527e
1 changed files with 13 additions and 3 deletions
|
@ -424,7 +424,12 @@ public abstract class PodStateManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setTempBasalCertain(boolean certain) {
|
public final void setTempBasalCertain(boolean certain) {
|
||||||
setSafe(() -> podState.setTempBasalCertain(certain));
|
setAndStore(() -> {
|
||||||
|
if (!Objects.equals(podState.isTempBasalCertain(), certain)) {
|
||||||
|
podState.setTempBasalCertain(certain);
|
||||||
|
onTbrChanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setTempBasal(DateTime startTime, Double amount, Duration duration) {
|
public final void setTempBasal(DateTime startTime, Double amount, Duration duration) {
|
||||||
|
@ -565,8 +570,13 @@ public abstract class PodStateManager {
|
||||||
clearTempBasal(false);
|
clearTempBasal(false);
|
||||||
}
|
}
|
||||||
podState.setLastUpdatedFromResponse(DateTime.now());
|
podState.setLastUpdatedFromResponse(DateTime.now());
|
||||||
podState.setTempBasalCertain(true);
|
if (!podState.isTempBasalCertain()) {
|
||||||
podState.setBasalCertain(true);
|
podState.setTempBasalCertain(true);
|
||||||
|
onTbrChanged();
|
||||||
|
}
|
||||||
|
if (!podState.isBasalCertain()) {
|
||||||
|
podState.setBasalCertain(true);
|
||||||
|
}
|
||||||
|
|
||||||
if (status instanceof PodInfoDetailedStatus) {
|
if (status instanceof PodInfoDetailedStatus) {
|
||||||
PodInfoDetailedStatus detailedStatus = (PodInfoDetailedStatus) status;
|
PodInfoDetailedStatus detailedStatus = (PodInfoDetailedStatus) status;
|
||||||
|
|
Loading…
Add table
Reference in a new issue