Simplify DateTimeType handling for Digiplex/EVO

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
Jacob Laursen 2024-12-09 23:28:05 +01:00 committed by lsiepel
parent 1f6f05ab83
commit 9b4f1d769c

View File

@ -15,7 +15,7 @@ package org.openhab.binding.digiplex.internal.handler;
import static org.openhab.binding.digiplex.internal.DigiplexBindingConstants.*; import static org.openhab.binding.digiplex.internal.DigiplexBindingConstants.*;
import static org.openhab.binding.digiplex.internal.handler.TypeUtils.openClosedFromBoolean; import static org.openhab.binding.digiplex.internal.handler.TypeUtils.openClosedFromBoolean;
import java.time.ZonedDateTime; import java.time.Instant;
import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable; import org.eclipse.jdt.annotation.Nullable;
@ -199,7 +199,7 @@ public class DigiplexZoneHandler extends BaseThingHandler {
if (event.getZoneNo() == DigiplexZoneHandler.this.zoneNo) { if (event.getZoneNo() == DigiplexZoneHandler.this.zoneNo) {
status = event.getStatus().toOpenClosedType(); status = event.getStatus().toOpenClosedType();
extendedStatus = new StringType(event.getStatus().toString()); extendedStatus = new StringType(event.getStatus().toString());
lastTriggered = new DateTimeType(ZonedDateTime.now()); lastTriggered = new DateTimeType(Instant.now());
updateChannels(false); updateChannels(false);
updateAreaNo(event.getAreaNo()); updateAreaNo(event.getAreaNo());
} }