mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-10 21:31:53 +01:00
adapted DataTimeType mapping to new ESH type (#239)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
This commit is contained in:
parent
3f1af862bc
commit
73688b7bd2
@ -20,7 +20,7 @@ public class TypeMapperTest {
|
||||
public void testDateTypeType() {
|
||||
DateTimeType ohType1 = new DateTimeType();
|
||||
DateTimeType ohType2 = (DateTimeType) TypeMapper.mapToOpenHABType(TypeMapper.mapToESHType(ohType1));
|
||||
assertEquals(ohType1, ohType2);
|
||||
assertEquals(ohType1.toString(), ohType2.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -10,6 +10,7 @@ package org.openhab.core.compat1x.internal;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import org.eclipse.smarthome.core.library.types.DateTimeType;
|
||||
import org.eclipse.smarthome.core.library.types.DecimalType;
|
||||
@ -73,7 +74,8 @@ public class TypeMapper {
|
||||
} else if (typeClass.equals(PercentType.class)) {
|
||||
result = new org.openhab.core.library.types.PercentType(type.toString());
|
||||
} else if (typeClass.equals(DateTimeType.class)) {
|
||||
result = new org.openhab.core.library.types.DateTimeType(cloneCalendar(type));
|
||||
result = new org.openhab.core.library.types.DateTimeType(
|
||||
GregorianCalendar.from(((DateTimeType) type).getZonedDateTime()));
|
||||
} else if (typeClass.equals(PointType.class)) {
|
||||
result = new org.openhab.core.library.types.PointType(type.toString());
|
||||
} else if (typeClass.equals(StringListType.class)) {
|
||||
|
Loading…
Reference in New Issue
Block a user