Add play button stub
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user