Merge pull request #230 from hybridgroup/change/pass-adaptor-to-driver-instances
Add direct Adaptor access inside Drivers
This commit is contained in:
commit
8d6bb1ba71
|
@ -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