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"))
.low(Profile.toMgdl(trJson.getDouble("targetBottom"), units))
.high(Profile.toMgdl(trJson.getDouble("targetTop"), units))
.reason(trJson.getString("reason"))
.reason(JsonHelper.safeGetString(trJson, "reason", ""))
._id(trJson.getString("_id"))
.source(Source.NIGHTSCOUT);
createOrUpdate(tempTarget);

View file

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