Skip to content

Commit

Permalink
fix(parseCommand): Set initial states output to 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgaticaq committed Aug 2, 2016
1 parent f5e1f69 commit cbae8f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const parseCommand = data => {
let _data = data.instruction.split('_');
port = _data[0];
state = _data[1];
let initial = [0, 0, 0, 0, 0];
let initial = [2, 2, 2, 2, 2];
const states = {off: 0, on: 1, status: 2};
initial[port - 1] = states[state];
speed = data.speed || 0;
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('meitrack-parser', () => {
imei: 353358017784062
};
const data = meitrack.parseCommand(command);
expect(data).to.match(/^@@([\x41-\x7A])(\d{1,3}),353358017784062,C01,0,10000\*([0-9A-F]{2})\r\n$/);
expect(data).to.match(/^@@([\x41-\x7A])(\d{1,3}),353358017784062,C01,0,12222\*([0-9A-F]{2})\r\n$/);
});

it('should return command reboot', () => {
Expand Down

0 comments on commit cbae8f1

Please sign in to comment.