From 7f3138585a4aaa27dbfc7ba3241a458cb8a5e0d3 Mon Sep 17 00:00:00 2001 From: Jacob Laursen Date: Thu, 28 Nov 2024 21:50:50 +0100 Subject: [PATCH] Simplify DateTimeType handling for LuxtronikHeatpump Signed-off-by: Jacob Laursen --- .../binding/luxtronikheatpump/internal/ChannelUpdaterJob.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bundles/org.openhab.binding.luxtronikheatpump/src/main/java/org/openhab/binding/luxtronikheatpump/internal/ChannelUpdaterJob.java b/bundles/org.openhab.binding.luxtronikheatpump/src/main/java/org/openhab/binding/luxtronikheatpump/internal/ChannelUpdaterJob.java index bb6be2b1977..cfff7fef76e 100644 --- a/bundles/org.openhab.binding.luxtronikheatpump/src/main/java/org/openhab/binding/luxtronikheatpump/internal/ChannelUpdaterJob.java +++ b/bundles/org.openhab.binding.luxtronikheatpump/src/main/java/org/openhab/binding/luxtronikheatpump/internal/ChannelUpdaterJob.java @@ -15,7 +15,6 @@ package org.openhab.binding.luxtronikheatpump.internal; import java.io.IOException; import java.time.DateTimeException; import java.time.Instant; -import java.time.ZoneId; import java.util.HashMap; import java.util.Map; @@ -125,8 +124,7 @@ public class ChannelUpdaterJob implements SchedulerRunnable, Runnable { if (itemClass == DateTimeItem.class && rawValue > 0) { try { - Instant instant = Instant.ofEpochSecond(rawValue.longValue()); - return new DateTimeType(instant.atZone(ZoneId.of("UTC"))); + return new DateTimeType(Instant.ofEpochSecond(rawValue.longValue())); } catch (DateTimeException e) { logger.warn("Invalid timestamp '{}' received from heatpump: {}", rawValue, e.getMessage()); }