Simplify DateTimeType handling for Ecovacs

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
Jacob Laursen 2024-11-10 21:27:11 +01:00 committed by lsiepel
parent 7cb8bf18ed
commit 4c176a8c82

View File

@ -14,7 +14,6 @@ package org.openhab.binding.ecovacs.internal.handler;
import static org.openhab.binding.ecovacs.internal.EcovacsBindingConstants.*;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@ -584,8 +583,7 @@ public class EcovacsVacuumHandler extends BaseThingHandler implements EcovacsDev
if (!cleanLogRecords.isEmpty()) {
CleanLogRecord record = cleanLogRecords.get(0);
updateState(CHANNEL_ID_LAST_CLEAN_START,
new DateTimeType(record.timestamp.toInstant().atZone(ZoneId.systemDefault())));
updateState(CHANNEL_ID_LAST_CLEAN_START, new DateTimeType(record.timestamp.toInstant()));
updateState(CHANNEL_ID_LAST_CLEAN_DURATION, new QuantityType<>(record.cleaningDuration, Units.SECOND));
updateState(CHANNEL_ID_LAST_CLEAN_AREA, new QuantityType<>(record.cleanedArea, SIUnits.SQUARE_METRE));
if (device.hasCapability(DeviceCapability.EXTENDED_CLEAN_LOG_RECORD)) {