def run(server_class=HTTPServer, handler_class=BaseHTTPRequestHandler):
server_address = ('', 8000)
httpd = server_class(server_address, handler_class)
httpd.serve_forever()
# RELAY.on() activate relay
# Import JSON config file as a dictionary for future reference by ID and IP.
# Thread: Listen for signal from thermostat. When received, use the function
# below and pass it the ID and IP.
# Function: send ID, IP, and delay to the server.
# Thread: Listen for activate command from server. When received, open relay.
评论列表
文章目录