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_temperatures_reset():
    logging.debug("Received request /historic/temperatures/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)

        HistoricTemperatureModel.delete_all()
        elapsedTime = time.monotonic() - startTime
        logging.debug("temperature reset request time: " +
                      str(round(elapsedTime, 5)) + " seconds")
        return res(204, timeUTC=datetime.utcnow())
    except mariadb.Error as e:
        abort(500, str(e))