]> git.basschouten.com Git - openhab-addons.git/commitdiff
[rrd4j] Improved the interpolation workaround (#17437)
authorjoerg1985 <16140691+joerg1985@users.noreply.github.com>
Wed, 18 Sep 2024 17:39:22 +0000 (19:39 +0200)
committerGitHub <noreply@github.com>
Wed, 18 Sep 2024 17:39:22 +0000 (19:39 +0200)
Signed-off-by: Jörg Sautter <joerg.sautter@gmx.net>
bundles/org.openhab.persistence.rrd4j/src/main/java/org/openhab/persistence/rrd4j/internal/RRD4jPersistenceService.java

index ed3d3d10d9103f68bff043be8e750f2c285859a7..059e8cf6cc4ac35d2c1d7b82aedc7f758c666ad3 100644 (file)
@@ -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);