Пример #1
0
    def delete_all():
        # Init
        returnValue = True

        # Execution
        RecentPressureModel.delete_all()
        RecentHumidityModel.delete_all()
        RecentCO2Model.delete_all()
        RecentTemperatureModel.delete_all()

        # Clean and return
        return returnValue
Пример #2
0
def recent_pressures_reset():
	logging.debug("Received request /recent/pressures/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)
		
		RecentPressureModel.delete_all()
		elapsedTime = time.monotonic() - startTime
		logging.debug("pressures reset request time: " + str(round(elapsedTime,5))+ " seconds")
		return res(204, timeUTC=datetime.utcnow())
	except mariadb.Error as e:
		abort(500, str(e))