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()
# Hardware Setup, e.g. Garage Door Remote
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, in this example with three buttons
await response.send(
"""