Simplify DateTimeType handling for VisualCrossing

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
Jacob Laursen 2024-12-10 21:49:32 +01:00 committed by Ciprian Pascu
parent be8adcba30
commit 6d16d2890a

View File

@ -20,7 +20,6 @@ import static org.openhab.core.types.UnDefType.UNDEF;
import java.math.BigDecimal;
import java.time.Instant;
import java.time.ZoneId;
import java.util.Collection;
import java.util.function.Function;
@ -205,8 +204,7 @@ class TypeBuilder {
return UNDEF;
}
var instant = Instant.ofEpochSecond(number.longValue());
var zonedDateTime = instant.atZone(ZoneId.of("UTC"));
return new DateTimeType(zonedDateTime);
return new DateTimeType(instant);
}
public static <T> State newDateTimeType(@Nullable T obj, Function<T, @Nullable Number> function) {