send command every 20s to prevent timing out

This commit is contained in:
Mike Enriquez
2015-10-03 22:04:51 -04:00
parent 98519c84dd
commit 2652f33a0a

View File

@@ -53,6 +53,14 @@ LogitechHarmonyPlatform.prototype = {
.then(function (client) {
self.log("Connected to Logitech Harmony remote hub");
// prevent connection from closing
setTimeout(function() {
setInterval(function() {
self.log("Sending command to prevent timeout");
client.getCurrentActivity();
}, 20000);
}, 5000);
callback(null, client);
});
};