Simplify DateTimeType handling for Ecobee

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
Jacob Laursen 2024-11-27 23:22:23 +01:00 committed by lsiepel
parent b5f36cbfa8
commit 7cb8bf18ed

View File

@ -14,7 +14,6 @@ package org.openhab.binding.ecobee.internal.handler;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZonedDateTime;
import javax.measure.Unit;
import javax.measure.quantity.Temperature;
@ -89,8 +88,7 @@ public final class EcobeeUtils {
}
public static State undefOrDate(@Nullable Instant instant, TimeZoneProvider timeZoneProvider) {
return instant == null ? UnDefType.UNDEF
: new DateTimeType(ZonedDateTime.ofInstant(instant, timeZoneProvider.getTimeZone()));
return instant == null ? UnDefType.UNDEF : new DateTimeType(instant);
}
public static State undefOrDate(@Nullable LocalDateTime ldt, TimeZoneProvider timeZoneProvider) {