Merge pull request #132 from KhaosT/master

[Philips Hue] retry if command failed due to api rate limit.
This commit is contained in:
Nick Farina
2015-08-28 22:29:52 -07:00
+6
View File
@@ -216,8 +216,14 @@ PhilipsHueAccessory.prototype = {
that.log(device.name + ", characteristic: " + characteristic + ", value: " + value + "."); that.log(device.name + ", characteristic: " + characteristic + ", value: " + value + ".");
} }
else { else {
if (err.code == "ECONNRESET") {
setTimeout(function() {
that.executeChange(api, device, characteristic, value);
}, 300);
} else {
that.log(err); that.log(err);
} }
}
}); });
}, },
// Get Services // Get Services