client for check
This commit is contained in:
		
							parent
							
								
									7551f4b351
								
							
						
					
					
						commit
						304a0241fa
					
				@ -17,13 +17,12 @@ for pin in BUTTON_PINS:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Callback functions to handle button presses
 | 
					# Callback functions to handle button presses
 | 
				
			||||||
def button_callback_1(channel):
 | 
					def button_callback_1(channel):
 | 
				
			||||||
    if check_current_status() == "PLAY":
 | 
					 | 
				
			||||||
        print("Button 1 pressed! Pausing playback.")
 | 
					 | 
				
			||||||
    client = create_client()
 | 
					    client = create_client()
 | 
				
			||||||
 | 
					    if check_current_status(client) == "PLAY":
 | 
				
			||||||
 | 
					        print("Button 1 pressed! Pausing playback.")
 | 
				
			||||||
        control_player(client, "PAUSE")
 | 
					        control_player(client, "PAUSE")
 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
        print("Button 1 pressed! Playing.")
 | 
					        print("Button 1 pressed! Playing.")
 | 
				
			||||||
        client = create_client()
 | 
					 | 
				
			||||||
        control_player(client, "PLAY")
 | 
					        control_player(client, "PLAY")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def button_callback_2(channel):
 | 
					def button_callback_2(channel):
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user