mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
Simplify DateTimeType handling for BigAssFan
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
parent
a8e2348d5a
commit
81f5a7fff9
@ -26,8 +26,6 @@ import java.nio.BufferOverflowException;
|
|||||||
import java.nio.channels.IllegalBlockingModeException;
|
import java.nio.channels.IllegalBlockingModeException;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.ZoneId;
|
|
||||||
import java.time.ZonedDateTime;
|
|
||||||
import java.time.format.DateTimeParseException;
|
import java.time.format.DateTimeParseException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -978,7 +976,7 @@ public class BigAssFanHandler extends BaseThingHandler {
|
|||||||
// (mac|name;TIME;VALUE;2017-03-26T14:06:27Z)
|
// (mac|name;TIME;VALUE;2017-03-26T14:06:27Z)
|
||||||
try {
|
try {
|
||||||
Instant instant = Instant.parse(messageParts[3]);
|
Instant instant = Instant.parse(messageParts[3]);
|
||||||
DateTimeType state = new DateTimeType(ZonedDateTime.ofInstant(instant, ZoneId.systemDefault()));
|
DateTimeType state = new DateTimeType(instant);
|
||||||
updateChannel(CHANNEL_TIME, state);
|
updateChannel(CHANNEL_TIME, state);
|
||||||
fanStateMap.put(CHANNEL_TIME, state);
|
fanStateMap.put(CHANNEL_TIME, state);
|
||||||
} catch (DateTimeParseException e) {
|
} catch (DateTimeParseException e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user