commit 9dc2bcbc22bea15710841249991446b6653880d4
parent 23b8632370e1eb00c556be5ed4ee421cc48ed95f
Author: Friedel Schön <[email protected]>
Date: Wed, 18 May 2022 11:28:55 +0200
fucking merge 2
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/client/main.py b/client/main.py
@@ -6,10 +6,12 @@ import urequests as requests
urlstatus = f"http://{config.SERVER}:{config.PORT}{config.ENDPOINTSTATUS}"
urlconnect = f"http://{config.SERVER}:{config.PORT}{config.ENDPOINTCONNECT}"
+
led = Pin(23, Pin.OUT)
trap = Pin(15, Pin.IN, Pin.PULL_DOWN)
connectbutton = Pin(4, Pin.IN, Pin.PULL_DOWN)
state = False
+mac = "0000000000000001"
#esp32.wake_on_ext1(pins = (button, button2), level = esp32.WAKEUP_ANY_HIGH)
while connection.isconnected():
@@ -17,13 +19,11 @@ while connection.isconnected():
print(trap.value())
new_state = trap.value()
led.value(new_state)
-
if state != new_state:
response = requests.post(urlstatus, json={ "mac": config.MAC, "status": new_state })
answer = response.json()
state = new_state
print(answer)
-
if connectbutton.value():
response = requests.post(urlconnect, json={ "mac": config.MAC })
answer = response.json()