diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaHandlerFactory.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaHandlerFactory.java index f36331241ea..69dbd2e78cc 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaHandlerFactory.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaHandlerFactory.java @@ -59,7 +59,7 @@ public class GardenaHandlerFactory extends BaseThingHandlerFactory { if (THING_TYPE_ACCOUNT.equals(thing.getThingTypeUID())) { return new GardenaAccountHandler((Bridge) thing, httpClientFactory, webSocketFactory, timeZoneProvider); } else { - return new GardenaThingHandler(thing, timeZoneProvider); + return new GardenaThingHandler(thing); } } } diff --git a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaThingHandler.java b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaThingHandler.java index 56f7115392b..e7f52edd147 100644 --- a/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaThingHandler.java +++ b/bundles/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/handler/GardenaThingHandler.java @@ -14,7 +14,6 @@ package org.openhab.binding.gardena.internal.handler; import static org.openhab.binding.gardena.internal.GardenaBindingConstants.*; -import java.time.ZonedDateTime; import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -44,7 +43,6 @@ import org.openhab.binding.gardena.internal.model.dto.command.ValveSetCommand.Va import org.openhab.binding.gardena.internal.util.PropertyUtils; import org.openhab.binding.gardena.internal.util.StringUtils; import org.openhab.binding.gardena.internal.util.UidUtils; -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; @@ -74,13 +72,11 @@ import org.slf4j.LoggerFactory; @NonNullByDefault public class GardenaThingHandler extends BaseThingHandler { private final Logger logger = LoggerFactory.getLogger(GardenaThingHandler.class); - private TimeZoneProvider timeZoneProvider; private @Nullable ScheduledFuture commandResetFuture; private Map commandDurations = new HashMap<>(); - public GardenaThingHandler(Thing thing, TimeZoneProvider timeZoneProvider) { + public GardenaThingHandler(Thing thing) { super(thing); - this.timeZoneProvider = timeZoneProvider; } @Override @@ -213,8 +209,7 @@ public class GardenaThingHandler extends BaseThingHandler { if (date == null) { return UnDefType.NULL; } else { - ZonedDateTime zdt = ZonedDateTime.ofInstant(date.toInstant(), timeZoneProvider.getTimeZone()); - return new DateTimeType(zdt); + return new DateTimeType(date.toInstant()); } } } catch (GardenaException e) {