Sfoglia il codice sorgente

snake case superior

etisab 10 anni fa
parent
commit
c10d909d57
1 ha cambiato i file con 6 aggiunte e 6 eliminazioni
  1. 6 6
      rebuild/yo.lua

+ 6 - 6
rebuild/yo.lua

@@ -6,20 +6,20 @@ 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 contentString = "api_token=" .. api_token .. "&username="..string.upper(yo_user)
-  local contentLength = string.len(contentString)
+  local content_string = "api_token=" .. api_token .. "&username=" .. string.upper(yo_user)
+  local content_length = string.len(content_string)
 
   debug('yo.yo: sending Yo')
   wifi.sleeptype(wifi.NONE_SLEEP)
   http.post(
     'https://api.justyo.co/yo/',
     'Content-Type: application/x-www-form-urlencoded\r\n' ..
-    'Content-length: ' .. contentLength .. '\r\n',
-    contentString,
+    'Content-length: ' .. content_length .. '\r\n',
+    content_string,
     function(status_code, response_data)
       wifi.sleeptype(wifi.LIGHT_SLEEP)
-      debug('yo.yo: status code ' .. status_code)
-      debug('yo.yo: response data ' .. response_data)
+      debug('yo.yo: status code: ' .. status_code)
+      debug('yo.yo: response data: ' .. (response_data or 'nil'))
     end
   )
 end