Skip to content

Commit

Permalink
Fix for #26.
Browse files Browse the repository at this point in the history
  • Loading branch information
bigkevmcd committed Feb 22, 2014
1 parent 5388890 commit 86577e0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
-------------

Expand Down
5 changes: 3 additions & 2 deletions lib/rfxcom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "rfxcom",
"version": "0.7.3",
"version": "0.7.4",
"author": "Kevin McDermott <[email protected]>",
"dependencies": {
"serialport": "~1.1.0"
"serialport": "~1.3.0"
},
"main": "rfxcom.js",
"devDependencies": {
Expand Down
1 change: 0 additions & 1 deletion test/lighting5.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,3 @@ describe('Lighting5 class', function(){
});
});
});

4 changes: 2 additions & 2 deletions test/rfxcom.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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();
});
Expand Down

0 comments on commit 86577e0

Please sign in to comment.