[python] Forgot old query

This commit is contained in:
giuliof 2019-07-28 16:42:45 +02:00
parent 7cbd141540
commit 1b416a5f22
2 changed files with 9 additions and 8 deletions

View File

@ -12,12 +12,10 @@ class TA:
self.db.close()
# Data is a dictionary of samples labelled according to database columns
def push(self, data):
values = ''
labels = ''
for i in data:
labels += ", %s" % i
values += ", %s" % str(data[i])
def put(self, data):
labels = ', '.join(tuple(map(str,data.keys())))
values = ', '.join(tuple(map(str,data.values())))
query = "INSERT INTO hourly (%s) VALUES (%s)" % (labels, values)
self.c.execute(query)

View File

@ -1,9 +1,12 @@
import subprocess
import DomoticGateway as dg
import TemperatureArchive as ta
import subprocess
from time import sleep
import sys
import pandas as pd # E R(enzie) keffaaaa
import pandas as pd
import matplotlib as mpl
mpl.use('Agg') # disable plot display
import matplotlib.pyplot as plt
import matplotlib.dates as pld