From 28808d993096e24d22acddf120404bc56ae0ec53 Mon Sep 17 00:00:00 2001 From: Laurent ARNAL Date: Sun, 18 Aug 2024 16:45:42 +0200 Subject: [PATCH] fix status in case of error Signed-off-by: Laurent ARNAL --- .../openhab/binding/linky/internal/handler/LinkyHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.linky/src/main/java/org/openhab/binding/linky/internal/handler/LinkyHandler.java b/bundles/org.openhab.binding.linky/src/main/java/org/openhab/binding/linky/internal/handler/LinkyHandler.java index 6b9fdc9b02f..7d6a369bcce 100644 --- a/bundles/org.openhab.binding.linky/src/main/java/org/openhab/binding/linky/internal/handler/LinkyHandler.java +++ b/bundles/org.openhab.binding.linky/src/main/java/org/openhab/binding/linky/internal/handler/LinkyHandler.java @@ -207,7 +207,9 @@ public class LinkyHandler extends BaseThingHandler { final LocalDateTime nextDayFirstTimeUpdate = now.plusDays(1).withHour(REFRESH_FIRST_HOUR_OF_DAY) .truncatedTo(ChronoUnit.HOURS); - updateStatus(ThingStatus.ONLINE); + if (this.getThing().getStatusInfo().getStatusDetail() != ThingStatusDetail.COMMUNICATION_ERROR) { + updateStatus(ThingStatus.ONLINE); + } refreshJob = scheduler.scheduleWithFixedDelay(this::updateData, ChronoUnit.MINUTES.between(now, nextDayFirstTimeUpdate) % REFRESH_INTERVAL_IN_MIN + 1,