diff --git a/buttons.py b/buttons.py index 7b93469..62c19aa 100644 --- a/buttons.py +++ b/buttons.py @@ -35,11 +35,11 @@ def button_callback_2(channel): def button_callback_3(channel): start_time = time.time() client = create_client() + disc_data = check_current_disc(client) # Wait until the button is released or held for more than 3 seconds while GPIO.input(BUTTON_PINS[2]) == GPIO.LOW: # Button is pressed (active low) if time.time() - start_time >= 3: # Check if 3 seconds have passed print("Button 3 held for 3 seconds! Sending RADIO2.") - disc_data = check_current_disc(client) update_disc(client, ["ytmusic",disc_data['name'],disc_data['type'],"RESET"]) time.sleep(1) update_disc(client, ["ytmusic",disc_data['name'],disc_data['type'],disc_data['id']])