Aller au contenu
Burberry

Requête HTTP sur Home Center 3

Recommended Posts

Bonjour !

 

Je souhaite insérer une requête HTTP dans une scène en bloc sur ma Home Center 3 ...

Plus précisément, je souhaite faire une requète vers le site "Pushing Box" ...

J'imagine que c'est tout simple, mais je ne trouve pas ! Si vous pouviez me guider ...

Faut-il écrire ca en LUA ? Si oui, quelqu'un pourrait-il me faire un petit script, svp ? Car, comme dit dans ma signature, je suis complétement étranger au LUA ... et réciproquement ! ;-)

Merci d'avance !

Et des boujoux, comme on dit par chez nous ! ;-)

Partager ce message


Lien à poster
Partager sur d’autres sites

Bonjour,

 

désoler pour la réponse tardive. Pour moi j'ai créer un commutateur binaire avec comme code dans MAIN ;

 

function QuickApp:turnOn()
    self:debug("binary switch turned on")
    self:updateProperty("value"true)
 
local http = net.HTTPClient()
http:request("http://---IP---/yuri.php?action=CHANGE_ENGINE_STATE&state=1&engine=RASP_SALON&q=on", {
 
   
options = {
            headers = {
                ["content-type"] = "application/json;charset=UTF-8",
                ["Authorization"] = "Basic TON-MOT-DE-PASSE",
                ["Cache-Control"] = "no-cache, no-store",                
                ["X-Fibaro-Version"] = "2"
            },
            method = "GET"
        },
})
 
end
 
function QuickApp:turnOff()
    self:debug("binary switch turned off")
    self:updateProperty("value"false
 
local http = net.HTTPClient()
http:request("http://---IP---/yuri.php?action=CHANGE_ENGINE_STATES&state=1&engine=RASP_SALON&q=off", {
 
options = {
            headers = {
                ["content-type"] = "application/json;charset=UTF-8",
                ["Authorization"] = "Basic TON-MOT-DE-PASSE",
                ["Cache-Control"] = "no-cache, no-store",                
                ["X-Fibaro-Version"] = "2"
            },
            method = "GET"
        },
})
 
end
function QuickApp:uibtnonOnReleased(event)
self:turnOn()
end
 
function QuickApp:uibtnoffOnReleased(event)
self:turnOff()
 
end

 

CA MARCHE TRES BIEN POUR MOI

Partager ce message


Lien à poster
Partager sur d’autres sites

×