added timestamp to start run log.

master
David Kebler 2020-06-21 11:37:15 -07:00
parent 5576ddea54
commit 62986be437
2 changed files with 9 additions and 9 deletions

View File

@ -7,7 +7,7 @@ const ZONE = {
simultaneous: false,
timing: {
hour: 6,
minute: 30,
minute: 0,
delta: 12
}
}

View File

@ -252,23 +252,23 @@ export { Irrigation }
// zone schedule start action
function start (duration,on,off,activeSch) {
console.log('start',duration,on,off,activeSch.name)
// console.log('start',duration,on,off,activeSch.name)
return new Promise(resolve => {
console.log('starting',activeSch.runID)
console.log('---watering for', duration,'minutes')
console.log(activeSch.name,'running for',duration,'minutes')
console.log(new Date().toString())
on()
const tick = setInterval(()=>{
console.log(activeSch.runID,'duration tick')
}, 1000)
// const tick = setInterval(()=>{
// console.log(activeSch.runID,'duration tick')
// }, 1000)
this.once('abort:'+activeSch.runID,()=> {
clearTimeout(run)
clearInterval(tick)
// clearInterval(tick)
off()
console.log('aborting run>>>', activeSch.runID)
})
const run = setTimeout(()=>{
console.log('stopping>>>',activeSch.runID)
clearInterval(tick)
// clearInterval(tick)
off()
this.removeAllListeners('abort:'+activeSch.runID)
resolve()