Add a "sequence stop" endpoint
This commit is contained in:
parent
9a698f6bd6
commit
8ec1694b02
10
index.js
10
index.js
|
@ -54,6 +54,7 @@ function createBLE () {
|
||||||
ble.on('delay', bDelay)
|
ble.on('delay', bDelay)
|
||||||
ble.on('counter', bCounter)
|
ble.on('counter', bCounter)
|
||||||
ble.on('sequence', bSequence)
|
ble.on('sequence', bSequence)
|
||||||
|
ble.on('stop', bSequenceStop)
|
||||||
ble.on('reset', bReset)
|
ble.on('reset', bReset)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -465,6 +466,7 @@ function bSequence (obj, cb) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (intval._state.sequence && sequence._state.active) {
|
if (intval._state.sequence && sequence._state.active) {
|
||||||
|
//should not occur with single client
|
||||||
sequence.setStop()
|
sequence.setStop()
|
||||||
intval._state.sequence = false
|
intval._state.sequence = false
|
||||||
log.info('sequence stop', { method : 'ble' })
|
log.info('sequence stop', { method : 'ble' })
|
||||||
|
@ -493,7 +495,13 @@ function bSequence (obj, cb) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function bSequenceStop (obj, cb) {
|
function bSequenceStop (obj, cb) {
|
||||||
|
//
|
||||||
|
if (intval._state.sequence && sequence._state.active) {
|
||||||
|
sequence.setStop()
|
||||||
|
intval._state.sequence = false
|
||||||
|
log.info('sequence stop', { method : 'ble' })
|
||||||
|
return cb()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function bReset (obj, cb) {
|
function bReset (obj, cb) {
|
||||||
|
|
Loading…
Reference in New Issue