Adding new functionality

This commit is contained in:
Vitor de Miranda Henrique
2016-12-09 14:12:10 -06:00
committed by GitHub
parent 4c9ca1a088
commit 53ebca47d9

View File

@@ -77,42 +77,13 @@ $(function() {
}
return "off";
}
self.turnFanOn = function(){
$.ajax({
type: "GET",
dataType: "json",
data: {"status": "on"},
url: "/plugin/enclosure/handleFan",
async: false
});
}
self.turnFanOff = function(){
self.handleIO = function(pin, value){
$.ajax({
type: "GET",
dataType: "json",
data: {"status": "off"},
url: "/plugin/enclosure/handleFan",
async: false
});
}
self.turnLightOn = function(){
$.ajax({
type: "GET",
dataType: "json",
data: {"status":"on"},
url: "/plugin/enclosure/handleLight",
async: false
});
}
self.turnLightOff = function(){
$.ajax({
type: "GET",
dataType: "json",
data: {"status":"off"},
url: "/plugin/enclosure/handleLight",
data: {"io": pin, "status": value},
url: "/plugin/enclosure/handleIO",
async: false
});
}