From e347f51efa9ba7be2336d2d64d4a3affe3d4cfaf Mon Sep 17 00:00:00 2001 From: "Jan N. Klug" Date: Tue, 16 May 2023 23:00:57 +0200 Subject: [PATCH] restore forecast Signed-off-by: Jan N. Klug --- .../core/persistence/internal/PersistenceManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/internal/PersistenceManager.java b/bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/internal/PersistenceManager.java index f0b1a165d09..3927115e80c 100644 --- a/bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/internal/PersistenceManager.java +++ b/bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/internal/PersistenceManager.java @@ -480,8 +480,11 @@ public void scheduleNewTimeSeries(String itemName, TimeSeries timeSeries) { public void addItem(Item item) { if (persistenceService instanceof QueryablePersistenceService) { - if (UnDefType.NULL.equals(item.getState()) && getMatchingConfigurations(RESTORE) - .anyMatch(configuration -> appliesToItem(configuration, item))) { + if (UnDefType.NULL.equals(item.getState()) + && (getMatchingConfigurations(RESTORE) + .anyMatch(configuration -> appliesToItem(configuration, item))) + || getMatchingConfigurations(FORECAST) + .anyMatch(configuration -> appliesToItem(configuration, item))) { restoreItemStateIfPossible(item); } if (getMatchingConfigurations(FORECAST).anyMatch(configuration -> appliesToItem(configuration, item))) {