Skip to content

Commit

Permalink
Update app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
santo-27 authored Nov 30, 2023
1 parent 9ab5573 commit 2d4cbe9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 2d4cbe9

Please sign in to comment.