added openAPSEnabledAlerts()

check for OpenAPS alerts enabled
This commit is contained in:
RoumenGeorgiev 2017-08-05 11:26:12 +03:00 committed by GitHub
parent 3d9df4e18e
commit ad122153a9

View file

@ -305,6 +305,7 @@ public class NSSettingsStatus {
return 0d; return 0d;
} }
@Nullable @Nullable
public JSONObject extentendedPumpSettings() { public JSONObject extentendedPumpSettings() {
try { try {
@ -343,5 +344,16 @@ public class NSSettingsStatus {
return ""; return "";
} }
public boolean openAPSEnabledAlerts() {
try {
JSONObject pump = extentendedPumpSettings();
if (pump != null && pump.has("openaps")) {
return pump.getBoolean("enableAlerts");
}
} catch (JSONException e) {
e.printStackTrace();
}
return false;
}
} }