Skip to content

Commit

Permalink
chore: led-test tool update
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelTaranto committed Aug 27, 2024
1 parent 7da3191 commit 52bb358
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions tools/led-test.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
const { setTimeout: delay } = require('node:timers/promises')

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

const ledManager = process.argv[2] === 'gaia' ?
require('../lib/upboard/gaia/led-manager')
:
require('../lib/upboard/sintra/led-manager')

const ledAddresses = process.argv[2] === 'tejo'
? require('../lib/upboard/tejo/led-addresses')
: null
const machine = process.argv[2]

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

ledManager.run(ledAddresses)
ledManager.run(machine)
.then(emit('brain', 'billValidatorPending'))
.then(() => delay(3000))
.then(emit('brain', 'billValidatorAccepting'))
Expand Down

0 comments on commit 52bb358

Please sign in to comment.