def mute(assistant): global muted while True: GPIO.wait_for_edge(button_pin, GPIO.RISING) sleep(.5) print('button') muted = not muted assistant.set_mic_mute(muted)