From 88d673c8514dae8339dae3663b61d77a9b66e225 Mon Sep 17 00:00:00 2001 From: Arttu Kuikka <75498768+ArttuKuikka@users.noreply.github.com> Date: Sun, 7 Jan 2024 20:42:38 +0200 Subject: [PATCH] nimien vaihdot ja testiin stop juttu --- main.py | 8 ++++---- test.py | 16 ++++++++++------ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/main.py b/main.py index bf5868d..00a410a 100644 --- a/main.py +++ b/main.py @@ -101,11 +101,11 @@ def main(url, token): red_button = Button(6, hold_time=0.05) red_button.when_held = lambda: handle_button_press(url, token, 1) - light_red_button = Button(13, hold_time=0.05) - light_red_button.when_held = lambda: handle_button_press(url, token, 2) + orange_button = Button(13, hold_time=0.05) + orange_button.when_held = lambda: handle_button_press(url, token, 2) - light_green_button = Button(19, hold_time=0.05) - light_green_button.when_held = lambda: handle_button_press(url, token, 3) + yellow_button = Button(19, hold_time=0.05) + yellow_button.when_held = lambda: handle_button_press(url, token, 3) green_button = Button(26, hold_time=0.05) green_button.when_held = lambda: handle_button_press(url, token, 4) diff --git a/test.py b/test.py index 210dd7b..2abd7d1 100644 --- a/test.py +++ b/test.py @@ -40,6 +40,8 @@ def do_GET(self): if self.path.startswith("/led"): changeLed(self.path) + elif self.path.startswith("/stop"): + exit() self.send_response(200) self.send_header("Content-type", "text/html") self.end_headers() @@ -51,10 +53,10 @@ def do_GET(self): Punainen (taso1) = {taso1}