From bf2216209d01a5164778c7c8f38c1b0255cf975b Mon Sep 17 00:00:00 2001 From: Khaos Tian Date: Fri, 28 Aug 2015 21:49:16 -0700 Subject: [PATCH] [Philips Hue] retry if command failed due to api rate limit. --- platforms/PhilipsHue.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platforms/PhilipsHue.js b/platforms/PhilipsHue.js index 0988b06..9bceaf0 100644 --- a/platforms/PhilipsHue.js +++ b/platforms/PhilipsHue.js @@ -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); + } } }); },