From 2d4cbe9a1f9d9e1acceffb6924880ffc598fbfe1 Mon Sep 17 00:00:00 2001 From: Santo_275 <142262438+santo-27@users.noreply.github.com> Date: Thu, 30 Nov 2023 22:58:27 +0530 Subject: [PATCH] Update app.py --- app.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app.py b/app.py index 82ae67c..9964464 100644 --- a/app.py +++ b/app.py @@ -67,6 +67,16 @@ def background_thread(): def index(): return render_template('index.html') +@app.route('/values') +def values(): + temperature, humidity, moisture = read_sensor_data() + inner_dict = { + 'temperature': temperature, + 'humidity': humidity, + 'moisture': moisture, + } + return jsonify(data = inner_dict) + @socketio.on('connect') def handle_connect(): print('Client connected')