diff --git a/lib/intval/index.js b/lib/intval/index.js index 3a6f2aa..12b57f0 100644 --- a/lib/intval/index.js +++ b/lib/intval/index.js @@ -46,6 +46,7 @@ intval.init = function () { time : 0, //length of frame, in ms delay : 0, //delay before start of frame, in ms open : 250, //delay before pausing frame in open state + openBwd : 400, closed : 100, //time that frame actually remains closed for expected : 630 //expected length of frame, in ms }, @@ -294,8 +295,9 @@ intval.frame = function (dir = null, time = null) { } if (time !== 0) { intval._state.frame.paused = true - setTimeout(intval._pause, intval._state.frame.open) + if (dir) { + setTimeout(intval._pause, intval._state.frame.open) //log.info('frame', { pausing : time + intval._state.frame.open }) setTimeout( () => { //log.info('frame', 'restarting') @@ -303,7 +305,7 @@ intval.frame = function (dir = null, time = null) { intval._startFwd() }, time + intval._state.frame.closed) } else { - log.info('frame', { pausing : time + intval._state.frame.open }) + setTimeout(intval._pause, intval._state.frame.openBwd) setTimeout( () => { //log.info('frame', 'restarting') intval._state.frame.paused = false