Added last valve open time

This commit is contained in:
Senad Uka
2016-05-08 05:17:12 +02:00
parent 2772baafbc
commit ac76654e2a
4 changed files with 21 additions and 1 deletions

View File

@@ -21,6 +21,15 @@ function setOutValveTo(controller_id, nextState) {
'set_by': 'server'
}
});
if(nextState === "open") {
ControllerState.update(state._id, {
'$set': {
'significantEvents.lastOutValveOpen': new Date(),
}
});
}
}
function openOutValve(controller_id) {