mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
Simplify DateTimeType handling for LuxtronikHeatpump
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
parent
520bda33a9
commit
7f3138585a
@ -15,7 +15,6 @@ package org.openhab.binding.luxtronikheatpump.internal;
|
||||
import java.io.IOException;
|
||||
import java.time.DateTimeException;
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneId;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -125,8 +124,7 @@ public class ChannelUpdaterJob implements SchedulerRunnable, Runnable {
|
||||
|
||||
if (itemClass == DateTimeItem.class && rawValue > 0) {
|
||||
try {
|
||||
Instant instant = Instant.ofEpochSecond(rawValue.longValue());
|
||||
return new DateTimeType(instant.atZone(ZoneId.of("UTC")));
|
||||
return new DateTimeType(Instant.ofEpochSecond(rawValue.longValue()));
|
||||
} catch (DateTimeException e) {
|
||||
logger.warn("Invalid timestamp '{}' received from heatpump: {}", rawValue, e.getMessage());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user