Add direct Adaptor access inside Drivers
This commit is contained in:
parent
6fa67f0e3b
commit
90cf0eed0a
|
@ -26,6 +26,7 @@ var Driver = module.exports = function Driver(opts) {
|
|||
this.name = opts.name;
|
||||
this.device = opts.device;
|
||||
this.connection = this.device.connection;
|
||||
this.adaptor = this.connection.adaptor;
|
||||
this.interval = extraParams.interval || 10;
|
||||
|
||||
this.commands = {};
|
||||
|
|
|
@ -34,6 +34,10 @@ describe("Driver", function() {
|
|||
expect(driver.connection).to.be.eql(device.connection);
|
||||
});
|
||||
|
||||
it("sets @connection to the device's connection adaptor", function() {
|
||||
expect(driver.adaptor).to.be.eql(device.connection.adaptor);
|
||||
});
|
||||
|
||||
it("sets @commands to an empty object by default", function() {
|
||||
expect(driver.commands).to.be.eql({});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue