From 897c446f02bac16936e3ff70b7c0e81bcd848dd3 Mon Sep 17 00:00:00 2001 From: GermanBluefox Date: Thu, 28 Nov 2013 09:02:41 +0100 Subject: [PATCH 1/2] Fix update interval if too short. --- ccu.io/adapter/ping/ping.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ccu.io/adapter/ping/ping.js b/ccu.io/adapter/ping/ping.js index 1a6297b0..0ffc54cd 100644 --- a/ccu.io/adapter/ping/ping.js +++ b/ccu.io/adapter/ping/ping.js @@ -2,7 +2,7 @@ * CCU.IO Ping Adapter * 11'2013 Bluefox * - * Version 0.1 + * Version 0.2 * */ var settings = require(__dirname+'/../../settings.js'); @@ -107,6 +107,7 @@ function pingInit () { Parent: dp }); dp += 2; + i++; } setObject(pingSettings.firstId, { @@ -119,6 +120,10 @@ function pingInit () { }); logger.info("adapter ping inserted objects"); + // Fix polling interval if too short + if (pingSettings.pollingInterval <= 5000 * (i + 1) { + pingSettings.pollingInterval = 5000 * (i + 1); + } logger.info("adapter ping polling enabled - interval "+pingSettings.pollingInterval+"ms"); From 930d7e079784d25ae5c33dac0ef88411946acebf Mon Sep 17 00:00:00 2001 From: GermanBluefox Date: Thu, 28 Nov 2013 09:06:13 +0100 Subject: [PATCH 2/2] Update ping.js --- ccu.io/adapter/ping/ping.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccu.io/adapter/ping/ping.js b/ccu.io/adapter/ping/ping.js index 0ffc54cd..1e49be8a 100644 --- a/ccu.io/adapter/ping/ping.js +++ b/ccu.io/adapter/ping/ping.js @@ -121,7 +121,7 @@ function pingInit () { logger.info("adapter ping inserted objects"); // Fix polling interval if too short - if (pingSettings.pollingInterval <= 5000 * (i + 1) { + if (pingSettings.pollingInterval <= 5000 * (i + 1)) { pingSettings.pollingInterval = 5000 * (i + 1); }