added timestamp to start run log.
parent
5576ddea54
commit
62986be437
|
@ -7,7 +7,7 @@ const ZONE = {
|
|||
simultaneous: false,
|
||||
timing: {
|
||||
hour: 6,
|
||||
minute: 30,
|
||||
minute: 0,
|
||||
delta: 12
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue