From 0a5b4e3c9e9955017a5c597c90d35d624d52bf2a Mon Sep 17 00:00:00 2001
From: Volker Richert <v.richert@addmore.de>
Date: Sun, 18 Dec 2016 17:22:04 +0100
Subject: [PATCH] adapt JSON  #61 (cherry picked from commit 454645b)

---
 .../nightscout/NightscoutUploadIntentService.java    | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/app/src/main/java/info/nightscout/android/upload/nightscout/NightscoutUploadIntentService.java b/app/src/main/java/info/nightscout/android/upload/nightscout/NightscoutUploadIntentService.java
index 1f6a4a4..6ac7129 100644
--- a/app/src/main/java/info/nightscout/android/upload/nightscout/NightscoutUploadIntentService.java
+++ b/app/src/main/java/info/nightscout/android/upload/nightscout/NightscoutUploadIntentService.java
@@ -259,11 +259,13 @@ public class NightscoutUploadIntentService extends IntentService {
         iob.put("bolusiob", record.getActiveInsulin());
 
         JSONObject status = new JSONObject();
-        // todo put real status in here....
-        status.put("status", "normal");
-        status.put("timestamp", record.getPumpDate());
-        status.put("bolusing", record.isBolusing());
-        status.put("suspended", record.isSuspended());
+        if (record.isBolusing()) {
+            status.put("bolusing", true);
+        } else if (record.isSuspended()) {
+            status.put("suspended", true);
+        } else {
+            status.put("status", "normal");
+        }
 
         JSONObject battery = new JSONObject();
         battery.put("percent", record.getBatteryPercentage());
-- 
GitLab