make devices option optional
This commit is contained in:
parent
31c6fd1290
commit
cd48f76ef3
1 changed files with 5 additions and 3 deletions
6
dmx.js
6
dmx.js
|
@ -3,10 +3,11 @@
|
|||
var util = require('util')
|
||||
var EventEmitter = require('events').EventEmitter
|
||||
|
||||
function DMX(devices) {
|
||||
function DMX(options) {
|
||||
var options = options || {}
|
||||
this.universes = {}
|
||||
this.drivers = {}
|
||||
this.devices = devices
|
||||
this.devices = options.devices || require('./devices')
|
||||
|
||||
this.registerDriver('null', require('./drivers/null'))
|
||||
this.registerDriver('enttec-usb-dmx-pro', require('./drivers/enttec-usb-dmx-pro'))
|
||||
|
@ -15,6 +16,7 @@ function DMX(devices) {
|
|||
|
||||
util.inherits(DMX, EventEmitter)
|
||||
|
||||
DMX.devices = require('./devices')
|
||||
DMX.Animation = require('./anim')
|
||||
|
||||
DMX.prototype.registerDriver = function(name, module) {
|
||||
|
|
Loading…
Reference in a new issue