From b18663934477a5585f2dc72aeab2a3872dbe455b Mon Sep 17 00:00:00 2001 From: Jacob Laursen Date: Mon, 9 Dec 2024 23:10:40 +0100 Subject: [PATCH] Simplify DateTimeType handling for Wolf Smartset Signed-off-by: Jacob Laursen --- .../wolfsmartset/internal/handler/WolfSmartsetUtils.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bundles/org.openhab.binding.wolfsmartset/src/main/java/org/openhab/binding/wolfsmartset/internal/handler/WolfSmartsetUtils.java b/bundles/org.openhab.binding.wolfsmartset/src/main/java/org/openhab/binding/wolfsmartset/internal/handler/WolfSmartsetUtils.java index cc6622049b2..0459442682f 100644 --- a/bundles/org.openhab.binding.wolfsmartset/src/main/java/org/openhab/binding/wolfsmartset/internal/handler/WolfSmartsetUtils.java +++ b/bundles/org.openhab.binding.wolfsmartset/src/main/java/org/openhab/binding/wolfsmartset/internal/handler/WolfSmartsetUtils.java @@ -12,7 +12,6 @@ */ package org.openhab.binding.wolfsmartset.internal.handler; -import java.time.ZonedDateTime; import java.util.Date; import javax.measure.Unit; @@ -20,7 +19,6 @@ import javax.measure.quantity.Temperature; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; -import org.openhab.core.i18n.TimeZoneProvider; import org.openhab.core.library.types.DateTimeType; import org.openhab.core.library.types.DecimalType; import org.openhab.core.library.types.OnOffType; @@ -83,9 +81,8 @@ public final class WolfSmartsetUtils { return value == null ? UnDefType.UNDEF : new PointType(value); } - public static State undefOrDate(@Nullable Date date, TimeZoneProvider timeZoneProvider) { - return date == null ? UnDefType.UNDEF - : new DateTimeType(ZonedDateTime.ofInstant(date.toInstant(), timeZoneProvider.getTimeZone())); + public static State undefOrDate(@Nullable Date date) { + return date == null ? UnDefType.UNDEF : new DateTimeType(date.toInstant()); } private static boolean isUnknown(Number value) {