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, simultaneous: false,
timing: { timing: {
hour: 6, hour: 6,
minute: 30, minute: 0,
delta: 12 delta: 12
} }
} }

View File

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