in the app there is a button when the user clicks on it, a door supposed to be opened for 7 seconds then close again
(the default is close state)
that's my code :
Code: Select all
if (cmd == "clickOnButton") {
var rVars = []
rVars.push({
name: "door",
val: 1
}) // 1 for opening , 0 for closing
_server.setRoomVariables(r, user, rVars)
function closethedoor() {
var rVars = []
rVars.push({
name: "door",
val: 0
})
_server.setRoomVariables(r, user, rVars)
}
setTimeout(closethedoor, 7000);
}
the door open successfully but it doesn't close after 7 seconds , that's the problem I found:
Can't find method java.util.Timer.schedule(adapter1,org.mozilla.javascript.Undefined).
also clearTimeOut doesn't work .