const ledControl = require('../lib/ssuboard/led-control')

const COLORS = ledControl.COLORS
const LEDS = ledControl.LEDS

ledControl.timed({type: 'pulse', color: COLORS.orange, range: LEDS.doorLeds}, 5000)

process.on('unhandledRejection', console.log)

const delay = require('delay')

const actionEmitter = require('../lib/action-emitter')
const ledManager = require('../lib/ssuboard/led-manager')

function emit (subsystem, action) {
  return () => actionEmitter.emit(subsystem, {action})
}

ledManager.run()
  .then(emit('brain', 'billValidatorPending'))
  .then(() => delay(3000))
  .then(emit('brain', 'ledsOff'))

add led-test