update_disc
This commit is contained in:
parent
18db046cca
commit
825bedcbc5
@ -1,6 +1,6 @@
|
|||||||
import RPi.GPIO as GPIO
|
import RPi.GPIO as GPIO
|
||||||
import time
|
import time
|
||||||
from lib.mqtt import create_client, control_player, create_config, check_current_status, check_current_disc
|
from lib.mqtt import create_client, control_player, create_config, check_current_status, check_current_disc, update_disc
|
||||||
|
|
||||||
client = create_client()
|
client = create_client()
|
||||||
|
|
||||||
@ -40,8 +40,8 @@ def button_callback_3(channel):
|
|||||||
if time.time() - start_time >= 3: # Check if 3 seconds have passed
|
if time.time() - start_time >= 3: # Check if 3 seconds have passed
|
||||||
print("Button 3 held for 3 seconds! Sending RADIO2.")
|
print("Button 3 held for 3 seconds! Sending RADIO2.")
|
||||||
disc_data = check_current_disc(client)
|
disc_data = check_current_disc(client)
|
||||||
control_player(client, f"ytube:{disc_data['name']}:{disc_data['type']}:RESET")
|
update_disc(client, f"ytube:{disc_data['name']}:{disc_data['type']}:RESET")
|
||||||
control_player(client, f"ytube:{disc_data['name']}:{disc_data['type']}:{disc_data['id']}")
|
update_disc(client, f"ytube:{disc_data['name']}:{disc_data['type']}:{disc_data['id']}")
|
||||||
return # Exit after sending RADIO2
|
return # Exit after sending RADIO2
|
||||||
|
|
||||||
# If button was not held for 3 seconds, send RADIO
|
# If button was not held for 3 seconds, send RADIO
|
||||||
|
Loading…
x
Reference in New Issue
Block a user