Simplify DateTimeType handling for BigAssFan

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
Jacob Laursen 2024-12-01 00:16:51 +01:00 committed by Ciprian Pascu
parent 4deb208c8a
commit b1eae44633

View File

@ -26,8 +26,6 @@ import java.nio.BufferOverflowException;
import java.nio.channels.IllegalBlockingModeException;
import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeParseException;
import java.util.Arrays;
import java.util.Collections;
@ -978,7 +976,7 @@ public class BigAssFanHandler extends BaseThingHandler {
// (mac|name;TIME;VALUE;2017-03-26T14:06:27Z)
try {
Instant instant = Instant.parse(messageParts[3]);
DateTimeType state = new DateTimeType(ZonedDateTime.ofInstant(instant, ZoneId.systemDefault()));
DateTimeType state = new DateTimeType(instant);
updateChannel(CHANNEL_TIME, state);
fanStateMap.put(CHANNEL_TIME, state);
} catch (DateTimeParseException e) {