From 89de130929175520f9dff1e7106095971e964d1d Mon Sep 17 00:00:00 2001 From: joerg1985 <16140691+joerg1985@users.noreply.github.com> Date: Wed, 18 Sep 2024 19:39:22 +0200 Subject: [PATCH] [rrd4j] Improved the interpolation workaround (#17437) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörg Sautter Signed-off-by: Ciprian Pascu --- .../persistence/rrd4j/internal/RRD4jPersistenceService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.persistence.rrd4j/src/main/java/org/openhab/persistence/rrd4j/internal/RRD4jPersistenceService.java b/bundles/org.openhab.persistence.rrd4j/src/main/java/org/openhab/persistence/rrd4j/internal/RRD4jPersistenceService.java index ed3d3d10d91..059e8cf6cc4 100644 --- a/bundles/org.openhab.persistence.rrd4j/src/main/java/org/openhab/persistence/rrd4j/internal/RRD4jPersistenceService.java +++ b/bundles/org.openhab.persistence.rrd4j/src/main/java/org/openhab/persistence/rrd4j/internal/RRD4jPersistenceService.java @@ -373,7 +373,7 @@ public class RRD4jPersistenceService implements QueryablePersistenceService { if (timestamp - 1 > db.getLastUpdateTime()) { // only do it if there is not already a value double lastValue = db.getLastDatasourceValue(DATASOURCE_STATE); - if (!Double.isNaN(lastValue)) { + if (!Double.isNaN(lastValue) && lastValue != value) { Sample sample = db.createSample(); sample.setTime(timestamp - 1); sample.setValue(DATASOURCE_STATE, lastValue);