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} +