From cd48f76ef3404dfbe5354865f09c568f0760cb9d Mon Sep 17 00:00:00 2001 From: Sebastian Wiedenroth Date: Sun, 29 Nov 2015 17:02:34 +0100 Subject: [PATCH] make devices option optional --- dmx.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dmx.js b/dmx.js index 92a8c32..734c992 100644 --- a/dmx.js +++ b/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.drivers = {} + 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) {