uploader battery fix
This commit is contained in:
parent
4b6276c0b1
commit
efc1988374
2 changed files with 3 additions and 5 deletions
|
@ -960,9 +960,7 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
|
||||||
}
|
}
|
||||||
|
|
||||||
int batteryLevel = BatteryLevel.getBatteryLevel();
|
int batteryLevel = BatteryLevel.getBatteryLevel();
|
||||||
JSONObject uploaderBattery = new JSONObject();
|
deviceStatus.uploaderBattery = batteryLevel;
|
||||||
uploaderBattery.put("uploaderBattery", batteryLevel);
|
|
||||||
deviceStatus.uploaderBattery = uploaderBattery;
|
|
||||||
|
|
||||||
deviceStatus.created_at = DateUtil.toISOString(new Date());
|
deviceStatus.created_at = DateUtil.toISOString(new Date());
|
||||||
deviceStatus.sendToNSClient();
|
deviceStatus.sendToNSClient();
|
||||||
|
|
|
@ -378,7 +378,7 @@ public class DeviceStatus {
|
||||||
public JSONObject enacted = null;
|
public JSONObject enacted = null;
|
||||||
public JSONObject suggested = null;
|
public JSONObject suggested = null;
|
||||||
public JSONObject iob = null;
|
public JSONObject iob = null;
|
||||||
public JSONObject uploaderBattery = null;
|
public int uploaderBattery = 0;
|
||||||
public String created_at = null;
|
public String created_at = null;
|
||||||
|
|
||||||
public JSONObject mongoRecord () {
|
public JSONObject mongoRecord () {
|
||||||
|
@ -392,9 +392,9 @@ public class DeviceStatus {
|
||||||
if (enacted != null) openaps.put("enacted", enacted);
|
if (enacted != null) openaps.put("enacted", enacted);
|
||||||
if (suggested != null) openaps.put("suggested", suggested);
|
if (suggested != null) openaps.put("suggested", suggested);
|
||||||
if (iob != null) openaps.put("iob", iob);
|
if (iob != null) openaps.put("iob", iob);
|
||||||
if (uploaderBattery != null) openaps.put("uploaderBattery", uploaderBattery);
|
|
||||||
record.put("openaps", openaps);
|
record.put("openaps", openaps);
|
||||||
}
|
}
|
||||||
|
if (uploaderBattery != 0) record.put("uploaderBattery", uploaderBattery);
|
||||||
if (created_at != null) record.put("created_at" , created_at);
|
if (created_at != null) record.put("created_at" , created_at);
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
Loading…
Reference in a new issue