Skip to content

Commit 6a93e05

Browse files
committed
Updated default delay to 1000ms
1 parent 9bd714c commit 6a93e05

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var xbox = new Xbox(ipAddress, liveDeviceId); // Create new xbox
2929
// Optional, defaults shown
3030
var options = {
3131
tries: 5,
32-
delay: 500,
32+
delay: 1000,
3333
waitForCallback: false
3434
};
3535

index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
var dgram = require('dgram');
22

33
const PORT = 5050;
4+
const DEFAULT_TRIES = 5;
5+
const DEFAULT_DELAY = 1000;
46

57
module.exports = Xbox;
68

@@ -20,7 +22,7 @@ Xbox.prototype.powerOn = function(options, callback) {
2022
}
2123

2224
// Retry up to options.tries times
23-
for (var i = 0; i < (options.tries || 5); i++) {
25+
for (var i = 0; i < (options.tries || DEFAULT_TRIES); i++) {
2426
setTimeout((function(xbox, i) {
2527
return function() {
2628
xbox.sendOn();
@@ -32,7 +34,7 @@ Xbox.prototype.powerOn = function(options, callback) {
3234
callback();
3335
}
3436
}
35-
})(this, i), i * (options.delay || 500));
37+
})(this, i), i * (options.delay || DEFAULT_DELAY));
3638
}
3739
};
3840

0 commit comments

Comments
 (0)