diff options
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1,13 +1,18 @@ from evdev import InputDevice, list_devices, ecodes +from urllib.request import urlopen SCANCODES = {0x11A: "up", 0x148: "down", 0x147: "left", 0x107: "right", 0x106: "ok", 0x141: "play/pause", 0x11c: "power", 0x103: "vol+", 0x142: "vol-"} device = None last = 0x00 +def homelab_request(request: str): + with urlopen(f"http://192.168.1.96/automate/{request}") as resp: + print(f"homelab request {request} response {resp.status}") + def do_action(action: str): if action == "ok": - print("ok") + homelab_request("hack_this_club") # /j for path in list_devices(): candidate = InputDevice(path) |
