if database:
c = database.cursor()
command="UPDATE sensor_values SET value={} WHERE id='{}'".format(value,id)
- print command
c.execute(command)
else:
print "No connection to DB"
data=GetData(sid,pid)
else:
data=GetData(sid,pid,Today(),Tomorrow())
+
+ if not data:
+ return
+
sID=[]
sTime=[]
sValue=[]
avg=np.mean(sValueDiff)
- print "Average="+str(avg)
-
for i in range(0,len(sTime)-1):
if sValueDiff[i]>avg*filterThreshold:
print "fixing %s : %5.2f %5.2f %5.2f" % (sTime[i],sValue[i],sValueFilt[i],sValueDiff[i])