mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 07:02:02 +01:00
Simplify DateTimeType handling for deCONZ
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
parent
8d0653a161
commit
e05d5ba84a
@ -19,8 +19,7 @@ import static org.mockito.Mockito.times;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.Instant;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
@ -119,10 +118,9 @@ public class DeconzTest {
|
||||
@Test
|
||||
public void dateTimeConversionTest() {
|
||||
DateTimeType dateTime = Util.convertTimestampToDateTime("2020-08-22T11:09Z");
|
||||
assertEquals(new DateTimeType(ZonedDateTime.parse("2020-08-22T11:09:00Z")), dateTime);
|
||||
assertEquals(new DateTimeType(Instant.parse("2020-08-22T11:09:00Z")), dateTime);
|
||||
|
||||
dateTime = Util.convertTimestampToDateTime("2020-08-22T11:09:47");
|
||||
assertEquals(new DateTimeType(ZonedDateTime.parse("2020-08-22T11:09:47Z")).toZone(ZoneId.systemDefault()),
|
||||
dateTime);
|
||||
assertEquals(new DateTimeType(Instant.parse("2020-08-22T11:09:47Z")), dateTime);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user