added pushon and off to solve a little bug
This commit is contained in:
parent
3e36752fc2
commit
4b532e00fa
|
|
@ -22,6 +22,16 @@ function changeSwitch(checkboxElem, idx) {
|
|||
}
|
||||
}
|
||||
|
||||
// Switch functions
|
||||
function changePush(idx, action) {
|
||||
if (action == 'on') {
|
||||
requestAPI(flask_server + "/api?type=command¶m=switchlight&idx=" + idx + "&switchcmd=On" );
|
||||
} else {
|
||||
requestAPI(flask_server + "/api?type=command¶m=switchlight&idx=" + idx + "&switchcmd=Off" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function refreshSwitches(updateSwitches, block) {
|
||||
$.each(updateSwitches, function (i, switchID) {
|
||||
var url = flask_server + "/api?type=devices&rid=" + switchID;
|
||||
|
|
|
|||
Loading…
Reference in New Issue