浏览代码

Add network request when button is pushed

DarkMorford 6 年之前
父节点
当前提交
5d3de868c5
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      code/main.py

+ 6 - 0
code/main.py

@@ -41,6 +41,12 @@ while True:
         import urequests as requests
 
         LED_PIN.off()
+
+        btn_id = config['buttonId']
+        endpoint = 'http://192.168.0.212:42069/rdp?id={0}'.format(btn_id)
+        res = requests.get(endpoint)
+#       print(res.status_code)
+
         time.sleep(5)
         button_triggered = False
         LED_PIN.on()