Foppe Hemminga 6 سال پیش
والد
کامیت
98a953ecf2
3فایلهای تغییر یافته به همراه39 افزوده شده و 9 حذف شده
  1. 3 2
      model.py
  2. 17 0
      status-10.json
  3. 19 7
      status-4.json

+ 3 - 2
model.py

@@ -74,8 +74,9 @@ def get_loot_level(this_id):
     this_loot_level = 0
     this_status_status, this_status_name, this_status_timestamp = _get_status(this_id)
     if this_status_status and len(this_status_status) > 1:
-        if this_status_status[0] == 'Okay' and 'Loot level' in this_status_status[1]:
-            this_loot_level = this_status_status[1][11:].strip()
+        pprint(this_status_status)
+        if this_status_status['description'] == 'Okay' and 'Loot level' in this_status_status['details']:
+            this_loot_level = this_status_status['details'][11:].strip()
     # print(this_loot_level)
     this_integer = _from_roman_to_integer(this_loot_level)
     this_status_dict = {"id": this_id, "name": this_status_name, "integer": this_integer, "roman": this_loot_level,

+ 17 - 0
status-10.json

@@ -0,0 +1,17 @@
+{
+  "id": 10,
+  "name": "Scrooge",
+  "integer": 3,
+  "roman": "III",
+  "text": {
+    "description": "Okay",
+    "details": "Loot level III",
+    "0": "Okay",
+    "1": "Loot level III",
+    "state": "Okay",
+    "color": "green",
+    "until": 0,
+    "note": "Please note, fields 0 and 1 will be removed. Please update software that uses these."
+  },
+  "timestamp": 1576239744
+}

+ 19 - 7
status-4.json

@@ -1,11 +1,23 @@
 {
   "id": 4,
   "name": "Duke",
-  "integer": 3,
-  "roman": "III",
-  "text": [
-    "Okay",
-    "Loot level III"
-  ],
-  "timestamp": 1575384697
+  "integer": 2,
+  "roman": "II",
+  "text": {
+    "description": "Okay",
+    "details": "Loot level II",
+    "0": "Okay",
+    "1": "Loot level II",
+    "state": "Okay",
+    "color": "green",
+    "until": 0,
+    "note": "Please note, fields 0 and 1 will be removed. Please update software that uses these."
+  },
+  "timestamp": 1576239723,
+  "alert": {
+    "15": false,
+    "10": false,
+    "5": false,
+    "1": false
+  }
 }