diff --git a/changelog.md b/changelog.md index 4fc10ed..95383a7 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,9 @@ +Version 0.7.4 +------------- + +- Support for serialport 1.3.0 which requires a callback for flush this fixes + bigkevmcd/node-rfxcom#26. + Version 0.7.3 ------------- diff --git a/lib/rfxcom.js b/lib/rfxcom.js index 7bb5c21..b1346dd 100644 --- a/lib/rfxcom.js +++ b/lib/rfxcom.js @@ -120,8 +120,9 @@ RfxCom.prototype.initialise = function(callback) { self.on("ready", function() { self.reset(function() { self.delay(500); - self.flush(); - self.getStatus(callback); + self.flush(function() { + self.getStatus(callback); + }); }); }); self.open(); diff --git a/package.json b/package.json index c07359e..92af8ab 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "rfxcom", - "version": "0.7.3", + "version": "0.7.4", "author": "Kevin McDermott ", "dependencies": { - "serialport": "~1.1.0" + "serialport": "~1.3.0" }, "main": "rfxcom.js", "devDependencies": { diff --git a/test/lighting5.spec.js b/test/lighting5.spec.js index 64b67e6..c758c14 100644 --- a/test/lighting5.spec.js +++ b/test/lighting5.spec.js @@ -99,4 +99,3 @@ describe('Lighting5 class', function(){ }); }); }); - diff --git a/test/rfxcom.spec.js b/test/rfxcom.spec.js index 19be2d6..a549f78 100644 --- a/test/rfxcom.spec.js +++ b/test/rfxcom.spec.js @@ -132,7 +132,7 @@ describe("RfxCom", function() { }), resetSpy = spyOn(device, "reset").andCallThrough(), delaySpy = spyOn(device, "delay"), - flushSpy = spyOn(device, "flush"), + flushSpy = spyOn(device, "flush").andCallThrough(), getStatusSpy = spyOn(device, "getStatus").andCallThrough(), openSpy = spyOn(device, "open").andCallFake(function() { device.emit("ready"); @@ -144,7 +144,7 @@ describe("RfxCom", function() { device.initialise(handler); expect(resetSpy).toHaveBeenCalled(); expect(delaySpy).toHaveBeenCalledWith(500); - expect(flushSpy).toHaveBeenCalled(); + expect(flushSpy).toHaveBeenCalledWith(jasmine.any(Function)); expect(getStatusSpy).toHaveBeenCalledWith(handler); expect(openSpy).toHaveBeenCalled(); });