diff --git a/POCloud/w_sqlite/poc.py b/POCloud/w_sqlite/poc.py index b6e324e..2e04f89 100644 --- a/POCloud/w_sqlite/poc.py +++ b/POCloud/w_sqlite/poc.py @@ -139,9 +139,9 @@ class start(threading.Thread, deviceBase): self.daemon = True self.forceSend = True - self.version = "2" - # self.device_address = "http://192.168.1.30/" - self.device_address = "http://localhost/" + self.version = "3" + self.device_address = "http://192.168.1.30" + # self.device_address = "http://localhost" self.cardLoopTimer = 600 self.finished = threading.Event() threading.Thread.start(self) @@ -240,8 +240,8 @@ class start(threading.Thread, deviceBase): runLoopStatus = "checkStoredValues" self.checkStoredValues(self.forceSend) - runLoopStatus = "getDataLoggerStatus()" - self.getDataLoggerStatus() + # runLoopStatus = "getDataLoggerStatus()" + # self.getDataLoggerStatus() if self.statusChanged: runLoopStatus = "getLatestXCards" @@ -282,7 +282,7 @@ class start(threading.Thread, deviceBase): events = data["events"] for event in events: if int(event["id"]) not in self.eventIds: - timestamp = calendar.timegm(time.strptime(event["datetime"], '%Y-%m-%dT%H:%M:%S.%fZ')) + timestamp = event["datetime"] # we have a new event self.sendtodbJSON("events", json.dumps(event), timestamp) self.eventIds.append(int(event["id"])) @@ -453,10 +453,10 @@ class start(threading.Thread, deviceBase): if s_p[i] is None: continue if s_p[i] != 0.0 and s_l[i] != 0.0: - newSc += "[" + str(s_p[i]) + ", " + str(s_l[i]) + "], " + newSc += "[" + str(round(s_p[i],3)) + ", " + str(round(s_l[i],3)) + "], " except: pass - newSc += "[" + str(s_p[0]) + ", " + str(s_l[0]) + "]" + newSc += "[" + str(round(s_p[0], 3)) + ", " + str(round(s_l[0], 3)) + "]" newSc += "]" for i in range(len(d_p)): @@ -464,10 +464,10 @@ class start(threading.Thread, deviceBase): if d_p[i] is None: continue if d_p[i] != 0.0 and d_l[i] != 0.0: - newDc += "[" + str(d_p[i]) + ", " + str(d_l[i]) + "], " + newDc += "[" + str(round(d_p[i], 3)) + ", " + str(round(d_l[i], 3)) + "], " except: pass - newDc += "[" + str(d_p[0]) + ", " + str(d_l[0]) + "]" + newDc += "[" + str(round(d_p[0], 3)) + ", " + str(round(d_l[0], 3)) + "]" newDc += "]" self.sendtodb("sc", newSc, card_timestamp)