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;
}
@Nullable
public JSONObject extentendedPumpSettings() {
try {
@ -343,5 +344,16 @@ public class NSSettingsStatus {
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;
}
}