Merge branch 'dev' into virtual_pump_Bug863

This commit is contained in:
Andy Rozman 2018-08-01 15:16:43 +01:00
commit bf34a3b41f
2 changed files with 13 additions and 2 deletions

View file

@ -698,7 +698,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
.duration(trJson.getInt("duration")) .duration(trJson.getInt("duration"))
.low(Profile.toMgdl(trJson.getDouble("targetBottom"), units)) .low(Profile.toMgdl(trJson.getDouble("targetBottom"), units))
.high(Profile.toMgdl(trJson.getDouble("targetTop"), units)) .high(Profile.toMgdl(trJson.getDouble("targetTop"), units))
.reason(trJson.getString("reason")) .reason(JsonHelper.safeGetString(trJson, "reason", ""))
._id(trJson.getString("_id")) ._id(trJson.getString("_id"))
.source(Source.NIGHTSCOUT); .source(Source.NIGHTSCOUT);
createOrUpdate(tempTarget); createOrUpdate(tempTarget);

View file

@ -14,6 +14,8 @@ import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.IobTotal; import info.nightscout.androidaps.data.IobTotal;
import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.db.TemporaryBasal; import info.nightscout.androidaps.db.TemporaryBasal;
import info.nightscout.androidaps.events.EventAppInitialized;
import info.nightscout.androidaps.events.EventConfigBuilderChange;
import info.nightscout.androidaps.events.EventExtendedBolusChange; import info.nightscout.androidaps.events.EventExtendedBolusChange;
import info.nightscout.androidaps.events.EventNewBG; import info.nightscout.androidaps.events.EventNewBG;
import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.events.EventPreferenceChange;
@ -80,7 +82,6 @@ public class StatuslinePlugin extends PluginBase {
@Override @Override
protected void onStart() { protected void onStart() {
MainApp.bus().register(this); MainApp.bus().register(this);
sendStatus();
super.onStart(); super.onStart();
} }
@ -182,6 +183,16 @@ public class StatuslinePlugin extends PluginBase {
sendStatus(); sendStatus();
} }
@Subscribe
public void onStatusEvent(final EventAppInitialized ev) {
sendStatus();
}
@Subscribe
public void onStatusEvent(final EventConfigBuilderChange ev) {
sendStatus();
}
@Subscribe @Subscribe
public void onStatusEvent(final EventRefreshOverview ev) { public void onStatusEvent(final EventRefreshOverview ev) {
//Filter events where loop is (de)activated //Filter events where loop is (de)activated