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

View File

@@ -216,7 +216,13 @@ PhilipsHueAccessory.prototype = {
that.log(device.name + ", characteristic: " + characteristic + ", value: " + value + ".");
}
else {
that.log(err);
if (err.code == "ECONNRESET") {
setTimeout(function() {
that.executeChange(api, device, characteristic, value);
}, 300);
} else {
that.log(err);
}
}
});
},