From 304a0241fa89c3f88f430bed5c8f8abfd17f7768 Mon Sep 17 00:00:00 2001 From: Karl Hudgell Date: Fri, 20 Sep 2024 20:48:35 +0100 Subject: [PATCH] client for check --- buttons.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/buttons.py b/buttons.py index 3e5d7fe..d953378 100644 --- a/buttons.py +++ b/buttons.py @@ -17,13 +17,12 @@ for pin in BUTTON_PINS: # Callback functions to handle button presses def button_callback_1(channel): - if check_current_status() == "PLAY": + client = create_client() + if check_current_status(client) == "PLAY": print("Button 1 pressed! Pausing playback.") - client = create_client() control_player(client, "PAUSE") else: print("Button 1 pressed! Playing.") - client = create_client() control_player(client, "PLAY") def button_callback_2(channel):