Search in sources :

Example 21 with Type

use of org.openhab.core.types.Type in project openhab1-addons by openhab.

the class TestSHCMessage method testDimmerColorMin.

/**
     * test data is: Dimmer Color: 0 (min)
     */
@Test
public void testDimmerColorMin() {
    String message = " PKT:SID=12;PC=203;MT=8;MGID=60;MID=10;MD=000000000003;85c7de93";
    SHCMessage shcMessage = new SHCMessage(message, packet);
    List<Type> values = shcMessage.getData().getOpenHABTypes();
    assertEquals(0, ((DecimalType) values.get(0)).intValue());
}
Also used : Type(org.openhab.core.types.Type) OnOffType(org.openhab.core.library.types.OnOffType) DecimalType(org.openhab.core.library.types.DecimalType) SHCMessage(org.openhab.binding.smarthomatic.internal.SHCMessage) Test(org.junit.Test)

Example 22 with Type

use of org.openhab.core.types.Type in project openhab1-addons by openhab.

the class TestSHCMessage method testEnvDistanceTyp.

/**
     * test data is: environment distance: 117 cm (typ)
     */
@Test
public void testEnvDistanceTyp() {
    String message = " PKT:SID=11;PC=68047;MT=8;MGID=11;MID=2;MD=01d400000000;aabb6194";
    SHCMessage shcMessage = new SHCMessage(message, packet);
    List<Type> values = shcMessage.getData().getOpenHABTypes();
    assertEquals(117, ((DecimalType) values.get(0)).intValue());
}
Also used : Type(org.openhab.core.types.Type) OnOffType(org.openhab.core.library.types.OnOffType) DecimalType(org.openhab.core.library.types.DecimalType) SHCMessage(org.openhab.binding.smarthomatic.internal.SHCMessage) Test(org.junit.Test)

Example 23 with Type

use of org.openhab.core.types.Type in project openhab1-addons by openhab.

the class TestSHCMessage method testEnvDistanceMin.

/**
     * test data is: enviroment distance: 0 cm (min)
     */
@Test
public void testEnvDistanceMin() {
    String message = " PKT:SID=11;PC=68047;MT=8;MGID=11;MID=2;MD=000000000000;f0922327";
    SHCMessage shcMessage = new SHCMessage(message, packet);
    List<Type> values = shcMessage.getData().getOpenHABTypes();
    assertEquals(0, ((DecimalType) values.get(0)).intValue());
}
Also used : Type(org.openhab.core.types.Type) OnOffType(org.openhab.core.library.types.OnOffType) DecimalType(org.openhab.core.library.types.DecimalType) SHCMessage(org.openhab.binding.smarthomatic.internal.SHCMessage) Test(org.junit.Test)

Example 24 with Type

use of org.openhab.core.types.Type in project openhab1-addons by openhab.

the class TestSHCMessage method testDimmerAnimationMin.

/**
     * test data is: Dimmer Animation: 0 (min)
     */
@Test
public void testDimmerAnimationMin() {
    String message = " PKT:SID=13;PC=534;MT=10;MGID=60;MID=2;MD=0000000000000000000000000000000000;8e4c4091";
    SHCMessage shcMessage = new SHCMessage(message, packet);
    List<Type> values = shcMessage.getData().getOpenHABTypes();
    assertEquals("AnimationMode", 0, ((DecimalType) values.get(0)).intValue());
    assertEquals("TimeoutSec", 0, ((DecimalType) values.get(1)).intValue());
    assertEquals("StartBrightness", 0, ((DecimalType) values.get(2)).intValue());
    assertEquals("EndBrightness", 0, ((DecimalType) values.get(3)).intValue());
}
Also used : Type(org.openhab.core.types.Type) OnOffType(org.openhab.core.library.types.OnOffType) DecimalType(org.openhab.core.library.types.DecimalType) SHCMessage(org.openhab.binding.smarthomatic.internal.SHCMessage) Test(org.junit.Test)

Example 25 with Type

use of org.openhab.core.types.Type in project openhab1-addons by openhab.

the class TestSHCMessage method testEnvBrightnessMin.

/**
     * test data is: environment brightness: 0 % (min)
     */
@Test
public void testEnvBrightnessMin() {
    String message = " PKT:SID=10;PC=123;MT=8;MGID=11;MID=1;MD=000000000006;b1c1e93d";
    SHCMessage shcMessage = new SHCMessage(message, packet);
    List<Type> values = shcMessage.getData().getOpenHABTypes();
    assertEquals(0, ((DecimalType) values.get(0)).intValue());
}
Also used : Type(org.openhab.core.types.Type) OnOffType(org.openhab.core.library.types.OnOffType) DecimalType(org.openhab.core.library.types.DecimalType) SHCMessage(org.openhab.binding.smarthomatic.internal.SHCMessage) Test(org.junit.Test)

Aggregations

Type (org.openhab.core.types.Type)72 DecimalType (org.openhab.core.library.types.DecimalType)69 OnOffType (org.openhab.core.library.types.OnOffType)68 Test (org.junit.Test)60 SHCMessage (org.openhab.binding.smarthomatic.internal.SHCMessage)40 IncreaseDecreaseType (org.openhab.core.library.types.IncreaseDecreaseType)27 StringType (org.openhab.core.library.types.StringType)27 DateTimeType (org.openhab.core.library.types.DateTimeType)26 HSBType (org.openhab.core.library.types.HSBType)26 OpenClosedType (org.openhab.core.library.types.OpenClosedType)26 PercentType (org.openhab.core.library.types.PercentType)26 StopMoveType (org.openhab.core.library.types.StopMoveType)26 UpDownType (org.openhab.core.library.types.UpDownType)26 DPT (tuwien.auto.calimero.dptxlator.DPT)20 Command (org.openhab.core.types.Command)2 UnDefType (org.openhab.core.types.UnDefType)2 Calendar (java.util.Calendar)1 Locale (java.util.Locale)1 StringTokenizer (java.util.StringTokenizer)1 IllegalClassException (org.apache.commons.lang.IllegalClassException)1