fix status in case of error

Signed-off-by: Laurent ARNAL <laurent@clae.net>
This commit is contained in:
Laurent ARNAL 2024-08-18 16:45:42 +02:00
parent 00c79dd12f
commit 28808d9930

View File

@ -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,