Exemple #1
0
	def delete_all():
		# Init
		returnValue = True

		# Execution
		HistoricPressureModel.delete_all()
		HistoricHumidityModel.delete_all()
		HistoricCO2Model.delete_all()
		HistoricTemperatureModel.delete_all()

		# Clean and return
		return returnValue
Exemple #2
0
def historic_humidities_reset():
	logging.debug("Received request /historic/humidities/reset")
	startTime = time.monotonic()
	try:
		# Requires a simple pw
		pw = req.args.get("pw")
		logging.debug("pw arg is: "+ str(pw))
		if pw != "A7G2V9":
			abort(403)
		
		HistoricHumidityModel.delete_all()
		elapsedTime = time.monotonic() - startTime
		logging.debug("Humidity reset request time: " + str(round(elapsedTime,5))+ " seconds")
		return res(204, timeUTC=datetime.utcnow())
	except mariadb.Error as e:
		logging.exception(e)
		abort(500, str(e))