Search in sources :

Example 91 with DecimalType

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

the class TestSHCMessage method testEnvBrightnessMax.

/**
     * test data is: environment brightness: 100 % (max)
     */
@Test
public void testEnvBrightnessMax() {
    String message = " PKT:SID=10;PC=123;MT=8;MGID=11;MID=1;MD=FE0000000006;1739bc80";
    SHCMessage shcMessage = new SHCMessage(message, packet);
    List<Type> values = shcMessage.getData().getOpenHABTypes();
    assertEquals(127, ((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 92 with DecimalType

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

the class TestSHCMessage method testDimmerColorAnimationMin.

/**
     * test data is: Dimmer Color Animation: (min)
     */
@Test
public void testDimmerColorAnimationMin() {
    String message = "PKT:SID=12;PC=9417;MT=10;MGID=60;MID=11;MD=0000000000000000000000000000000000;1c733ace";
    SHCMessage shcMessage = new SHCMessage(message, packet);
    List<Type> values = shcMessage.getData().getOpenHABTypes();
    assertEquals("Repeat", 0, ((DecimalType) values.get(0)).intValue());
    assertEquals("AutoReverse", OnOffType.OFF, (values.get(1)));
    assertEquals("Time0", 0, ((DecimalType) values.get(2)).intValue());
    assertEquals("Color0", 0, ((DecimalType) values.get(3)).intValue());
    assertEquals("Time1", 0, ((DecimalType) values.get(4)).intValue());
    assertEquals("Color1", 0, ((DecimalType) values.get(5)).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 93 with DecimalType

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

the class TestSHCMessage method testGenericBattTyp.

/**
     * test data for the generic messages battery: 66 %
     */
@Test
public void testGenericBattTyp() {
    String message = " PKT:SID=10;PC=164;MT=8;MGID=0;MID=5;MD=840000000004;9f44b737";
    SHCMessage shcMessage = new SHCMessage(message, packet);
    List<Type> values = shcMessage.getData().getOpenHABTypes();
    assertEquals(66, ((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 94 with DecimalType

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

the class TestSHCMessage method testWeatherBaroTempTyp.

/**
     * test data is: weather barometric pressure: 96461 temp: -1
     */
@Test
public void testWeatherBaroTempTyp() {
    String message = " PKT:SID=11;PC=68029;MT=8;MGID=10;MID=3;MD=bc75ffff8000;b8d3498b";
    SHCMessage shcMessage = new SHCMessage(message, packet);
    List<Type> values = shcMessage.getData().getOpenHABTypes();
    assertEquals(96491, ((DecimalType) values.get(0)).intValue());
    assertEquals(-1, ((DecimalType) values.get(1)).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 95 with DecimalType

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

the class TestSHCMessage method testWeatherTempTyp.

/**
     * test data is: weather temperature: 22.10
     */
@Test
public void testWeatherTempTyp() {
    String message = " PKT:SID=11;PC=68026;MT=8;MGID=10;MID=1;MD=08a200000000;3bd82894";
    SHCMessage shcMessage = new SHCMessage(message, packet);
    List<Type> values = shcMessage.getData().getOpenHABTypes();
    assertEquals(2210, ((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

DecimalType (org.openhab.core.library.types.DecimalType)222 Test (org.junit.Test)70 StringType (org.openhab.core.library.types.StringType)69 OnOffType (org.openhab.core.library.types.OnOffType)63 PercentType (org.openhab.core.library.types.PercentType)43 State (org.openhab.core.types.State)40 Type (org.openhab.core.types.Type)39 NumberItem (org.openhab.core.library.items.NumberItem)38 SHCMessage (org.openhab.binding.smarthomatic.internal.SHCMessage)37 DateTimeType (org.openhab.core.library.types.DateTimeType)29 BigDecimal (java.math.BigDecimal)23 Calendar (java.util.Calendar)23 HSBType (org.openhab.core.library.types.HSBType)20 SwitchItem (org.openhab.core.library.items.SwitchItem)18 IOException (java.io.IOException)16 StringItem (org.openhab.core.library.items.StringItem)16 ConfigurationException (org.osgi.service.cm.ConfigurationException)16 RollershutterItem (org.openhab.core.library.items.RollershutterItem)15 ContactItem (org.openhab.core.library.items.ContactItem)14 DimmerItem (org.openhab.core.library.items.DimmerItem)14