From 0a46ff2a797ce92d0b98948fdd72be2b70e38c39 Mon Sep 17 00:00:00 2001 From: Jacob Laursen Date: Tue, 10 Dec 2024 21:56:15 +0100 Subject: [PATCH] Simplify DateTimeType handling for Foobot Signed-off-by: Jacob Laursen --- .../binding/foobot/internal/handler/FoobotDeviceHandler.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/handler/FoobotDeviceHandler.java b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/handler/FoobotDeviceHandler.java index 5c33d8f6f5f..0c0204f4d57 100644 --- a/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/handler/FoobotDeviceHandler.java +++ b/bundles/org.openhab.binding.foobot/src/main/java/org/openhab/binding/foobot/internal/handler/FoobotDeviceHandler.java @@ -15,8 +15,6 @@ package org.openhab.binding.foobot.internal.handler; import java.math.BigDecimal; import java.time.Duration; import java.time.Instant; -import java.time.ZoneId; -import java.time.ZonedDateTime; import java.util.Map; import javax.measure.Unit; @@ -201,8 +199,7 @@ public class FoobotDeviceHandler extends BaseThingHandler { } else { final Unit stateUnit = sensor.getUnit(unit); if (sensor == FoobotSensor.TIME) { - return new DateTimeType( - ZonedDateTime.ofInstant(Instant.ofEpochSecond(Long.parseLong(value)), ZoneId.systemDefault())); + return new DateTimeType(Instant.ofEpochSecond(Long.parseLong(value))); } else if (stateUnit == null) { return new DecimalType(value); } else {