From 820435e65451df7facc0dd663d40653e9f8e5262 Mon Sep 17 00:00:00 2001 From: William Moore Date: Mon, 4 Apr 2022 14:37:06 -0500 Subject: [PATCH] Add new service and update set point --- temperato.py | 2 +- report_temp.py => web.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) rename report_temp.py => web.py (87%) diff --git a/temperato.py b/temperato.py index ba3df59..6f240b6 100644 --- a/temperato.py +++ b/temperato.py @@ -23,7 +23,7 @@ import time import os import json -set_point = 95.0 +set_point = 82.22 sleep_timer = 15 spi = board.SPI() diff --git a/report_temp.py b/web.py similarity index 87% rename from report_temp.py rename to web.py index 02bf526..39a8dd9 100644 --- a/report_temp.py +++ b/web.py @@ -17,8 +17,15 @@ import board import digitalio import adafruit_max31865 +from flask import Flask + +app = Flask(__name__) spi = board.SPI() cs = digitalio.DigitalInOut(board.D26) sensor = adafruit_max31865.MAX31865(spi, cs, wires=3) -print(sensor.temperature) + +@app.route('/') +def get_sensor(): + return {'temperature': sensor.temperature} +