Fixup interval in driver
This commit is contained in:
parent
ce41885ab4
commit
b7467e7a63
|
@ -21,11 +21,12 @@ var Basestar = require('./basestar'),
|
|||
// Returns a new Driver
|
||||
var Driver = module.exports = function Driver(opts) {
|
||||
opts = opts || {};
|
||||
var extraParams = opts.extraParams || {}
|
||||
|
||||
this.name = opts.name;
|
||||
this.device = opts.device;
|
||||
this.connection = this.device.connection;
|
||||
this.interval = opts.interval || 10;
|
||||
this.interval = extraParams.interval || 10;
|
||||
|
||||
this.commands = {};
|
||||
};
|
||||
|
|
|
@ -40,7 +40,13 @@ describe("Driver", function() {
|
|||
|
||||
it("sets @interval to 10ms by default, or the provided value", function() {
|
||||
expect(driver.interval).to.be.eql(10);
|
||||
driver = new Driver({ name: 'driver', device: device, interval: 2000 });
|
||||
driver = new Driver({
|
||||
name: 'driver',
|
||||
device: device,
|
||||
extraParams: {
|
||||
interval: 2000
|
||||
}
|
||||
});
|
||||
expect(driver.interval).to.be.eql(2000);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue