2016-09-21 41 views

回答

0

对于VD按钮,你的代码应该是这样的:

local http = Net.FHttp("192.168.0.32", 80); 
local response = http:GET("/core/api/api.php?param=2335"); 

主回路部分(在场景)将有有点儿不同的语法:

local http = net.HTTPClient(); 
http : request('https://api.lifx.com/v1/lights/label:Light1/state.json?selector=label:Light1&power=on&brightness=0.7', { 
    options = { 
     method = "PUT", 
     headers = { 
      ['Authorization'] = 'Bearer cce26ealkadj764' 
     }, 
     data = "" 
    }, 
    success = function(response) fibaro:debug (response.data) end, 
    error = function(err) fibaro:debug ("Error:" .. err) end 
});