Esempio n. 1
0
	def POST(self):
		#submit a meter reading, should be a json object
		webData = web.data()

		data = jsonvalidator.validateWebData(webData)

		timestamp = data['timestamp']
		value = data['value']

		dbconnector.writeMeterReading(timestamp, value)

		rawData = dbconnector.getAllData()
		usageRates = meteranalysis.getUsageRate(rawData)

		return render.data(usageRates, rawData)
Esempio n. 2
0
	def GET(self):
		#display general usage data and charts
		rawData = dbconnector.getAllData()
		usageRates = meteranalysis.getUsageRate(rawData)

		return render.data(usageRates, rawData)