diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java index f3df77fe64..362e5727c9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java @@ -960,9 +960,7 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain } int batteryLevel = BatteryLevel.getBatteryLevel(); - JSONObject uploaderBattery = new JSONObject(); - uploaderBattery.put("uploaderBattery", batteryLevel); - deviceStatus.uploaderBattery = uploaderBattery; + deviceStatus.uploaderBattery = batteryLevel; deviceStatus.created_at = DateUtil.toISOString(new Date()); deviceStatus.sendToNSClient(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/DeviceStatus.java b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/DeviceStatus.java index 0d4f5b423f..0d72464b73 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/DeviceStatus.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/DeviceStatus.java @@ -378,7 +378,7 @@ public class DeviceStatus { public JSONObject enacted = null; public JSONObject suggested = null; public JSONObject iob = null; - public JSONObject uploaderBattery = null; + public int uploaderBattery = 0; public String created_at = null; public JSONObject mongoRecord () { @@ -392,9 +392,9 @@ public class DeviceStatus { if (enacted != null) openaps.put("enacted", enacted); if (suggested != null) openaps.put("suggested", suggested); if (iob != null) openaps.put("iob", iob); - if (uploaderBattery != null) openaps.put("uploaderBattery", uploaderBattery); record.put("openaps", openaps); } + if (uploaderBattery != 0) record.put("uploaderBattery", uploaderBattery); if (created_at != null) record.put("created_at" , created_at); } catch (JSONException e) { e.printStackTrace();