mirror of https://github.com/Lapikud/Viido.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
532 B
27 lines
532 B
#!/usr/bin/env python3 |
|
from bottle import get, post, request, run |
|
import projektor |
|
|
|
@get("/status") |
|
def status(): |
|
print("asking status") |
|
return projektor.get_status() |
|
|
|
@post("/status") |
|
def set_status(): |
|
mode = request.forms.get("mode") |
|
print("SETTING STATUS TO", mode) |
|
if mode == "off": |
|
projektor.off() |
|
elif mode == "hdmi": |
|
projektor.on_hdmi() |
|
elif mode == "vga": |
|
projektor.on_vga() |
|
|
|
|
|
return "OK" |
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
run(host="127.0.0.1", port=6999, debug=True)
|
|
|