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());
}
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());
}
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());
}
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());
}
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());
}
Aggregations