statistics
This commit is contained in:
parent
fa26dd2418
commit
9621df8711
15
config.py
15
config.py
|
@ -1,5 +1,6 @@
|
|||
# 数据库插入类型
|
||||
import base64
|
||||
import copy
|
||||
import time
|
||||
|
||||
rfid_type = ["TEXT", "TEXT", "FLOAT", "INT32"]
|
||||
|
@ -134,17 +135,19 @@ def is_warning(deviceId, v, t):
|
|||
|
||||
|
||||
def insert_to_warning_sql(deviceId, v, t):
|
||||
measurements[t].append("reason")
|
||||
measurements[t].append("solve")
|
||||
dataTypes[t].append("TEXT")
|
||||
dataTypes[t].append("TEXT")
|
||||
ml = copy.deepcopy(measurements[t])
|
||||
dt = copy.deepcopy(dataTypes[t])
|
||||
ml.append("reason")
|
||||
ml.append("solve")
|
||||
dt.append("TEXT")
|
||||
dt.append("TEXT")
|
||||
v.append("无")
|
||||
v.append("无")
|
||||
return {
|
||||
"devices": ["root.warning." + deviceId],
|
||||
"timestamps": [int(time.time() * 1000)],
|
||||
"measurements_list": [measurements[t]],
|
||||
"data_types_list": [dataTypes[t]],
|
||||
"measurements_list": [ml],
|
||||
"data_types_list": [dt],
|
||||
"values_list": [v],
|
||||
"is_aligned": False
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue