Add play button stub

This commit is contained in:
2025-12-31 00:10:27 +01:00
parent 8466e77a61
commit 1299c27284
2 changed files with 23 additions and 0 deletions

View File

@@ -1,6 +1,21 @@
from button_handler import ButtonHandler
import urequests as requests
from wifi import Wifi
from led import LED
def send_request():
try:
print("Action triggered")
r = requests.post(
"http://192.168.15.119/command/party/play",
headers={
"Authorization": "Bearer 0eed89e8-7625-4f8d-bf2a-0872aede0efb"
}
)
r.close()
except Exception as ex:
print("Failed to trigger action", ex)
try:
LED_PIN = 2
SSID = "Proximus-Home-AA68_EXT"
@@ -13,5 +28,8 @@ try:
wifi.connect()
led.on()
button = ButtonHandler(14, send_request)
except Exception as e:
print("Unable to start", e)