mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
Simplify DateTimeType handling for VisualCrossing
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
parent
1a76e5522c
commit
df8f92e847
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user