diff --git a/bundles/org.openhab.binding.ondilo/README.md b/bundles/org.openhab.binding.ondilo/README.md index 85d3001cd8797..4b5a033b49f4c 100644 --- a/bundles/org.openhab.binding.ondilo/README.md +++ b/bundles/org.openhab.binding.ondilo/README.md @@ -28,7 +28,7 @@ Each Ondilo ICO will appear as a new Thing in the inbox. Ondilo ICO takes measures every hour. Higher polling will not increase the update interval. -The binding automatically adjusts the polling schedule to match the expected time of the next measure, which is typically 1 hour (plus 1.5 minutes buffer) after the previous measure. +The binding automatically adjusts the polling schedule to match the expected time of the next measure, which is typically 1 hour (plus 3 minutes buffer) after the previous measure. The requests to the Ondilo Customer API are limited to the following per user quotas: diff --git a/bundles/org.openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloBridge.java b/bundles/org.openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloBridge.java index d1418bf8b73c6..53149d7796550 100644 --- a/bundles/org.openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloBridge.java +++ b/bundles/org.openhab.binding.ondilo/src/main/java/org/openhab/binding/ondilo/internal/OndiloBridge.java @@ -134,11 +134,11 @@ public synchronized void pollOndiloICOs() { private void adaptPollingToValueTime(Instant lastValueTime, int refreshInterval) { // Measures are taken every 60 minutes, so we should be able to - // retrieve next data directly 60 minutes + buffer of 90 seconds after the last measure. + // retrieve next data directly 60 minutes + buffer of 3 minutes after the last measure. // This can help to avoid polling too frequently and hitting API rate limits. - // If the last measure was taken at 12:00°°, we will poll again at 13:01³°. + // If the last measure was taken at 12:00, we will poll again at 13:03. // This allows for a buffer in case the measure is not available immediately. - Instant nextValueTime = lastValueTime.plusSeconds(3690); // 60 minutes + 1 minute + 30 seconds buffer + Instant nextValueTime = lastValueTime.plusSeconds(3780); // 60 minutes + 3 minutes Instant now = Instant.now(); Instant scheduledTime = now.plusSeconds(refreshInterval); if (nextValueTime.isBefore(scheduledTime)) { @@ -148,7 +148,7 @@ private void adaptPollingToValueTime(Instant lastValueTime, int refreshInterval) if (ondiloBridgePollingJob != null) { ondiloBridgePollingJob.cancel(true); } - ondiloBridgePollingJob = scheduler.scheduleWithFixedDelay(() -> pollOndiloICOs(), delay, + this.ondiloBridgePollingJob = scheduler.scheduleWithFixedDelay(() -> pollOndiloICOs(), delay, refreshInterval, TimeUnit.SECONDS); logger.trace("Rescheduled polling to {} (delay {} seconds)", nextValueTime, delay); }