Prechádzať zdrojové kódy

proper req ending. http only, temporary

etisab 10 rokov pred
rodič
commit
4428eb6a09
2 zmenil súbory, kde vykonal 4 pridanie a 3 odobranie
  1. 2 1
      rebuild/led.lua
  2. 2 2
      rebuild/yo.lua

+ 2 - 1
rebuild/led.lua

@@ -1,5 +1,5 @@
 -- local led_pin = 1 --GPIO 5
-local led_pin = 2 --nodeMCU LED
+local led_pin = 1 --nodeMCU LED
 local override_pin = 4 --GPIO 4
 
 local HEARTBEAT_times = {40, 200, 40, 900} --format is alternating on and off times in ms
@@ -48,6 +48,7 @@ local print = print
 module(...)
 
 function testcall()
+  do_pattern(patterns.FADEIN)
   do_pattern(patterns.FADEOUT)
 end
 

+ 2 - 2
rebuild/yo.lua

@@ -12,12 +12,12 @@ function yo(yo_user, api_token)
   assert(yo_user ~= '', 'yo_user must not be empty string')
   assert(api_token ~= '', 'api_token must not be empty string')
 
-  local content_string = "api_token=" .. api_token .. "&username=" .. string.upper(yo_user)
+  local content_string = "api_token=" .. api_token .. "&username=" .. string.upper(yo_user) .. '\r\n\r\n'
   local content_length = string.len(content_string)
 
   debug_message('yo.yo: sending Yo')
   http.post(
-    'https://api.justyo.co/yo/',
+    'http://api.justyo.co/yo/',
     'Content-Type: application/x-www-form-urlencoded\r\n' ..
     'Content-length: ' .. content_length .. '\r\n',
     content_string,