import tinyweb
from machine import Pin
from machine import reset
from time import sleep
import json
settings=json.loads(''.join(open('settings.json').readlines()))
# Create web server application
app = tinyweb.webserver()
Button={}
for name in settings["buttons"].keys():
Button[name]=Pin(settings["buttons"][name]["pin"],Pin.OUT)
Button[name].off()
# Index page
@app.route('/')
async def index(request, response):
# Start HTTP response with content-type text/html
await response.start_html()
# Send actual HTML page
await response.send('''
George\'s Garage
\n''')
@app.route('/reset')
async def index(request, response):
# Start HTTP response with content-type text/html
await response.start_html()
# Send actual HTML page
await response.send('''