use of org.openhab.core.library.types.DecimalType in project openhab1-addons by openhab.
the class TestSHCMessage method testWeatherBaroTempMax.
/**
* test data is: weather barometric pressure: 131071 temp: 32767
*/
@Test
public void testWeatherBaroTempMax() {
String message = " PKT:SID=11;PC=68029;MT=8;MGID=10;MID=3;MD=FFFFBFFFFFFF;a6819187";
SHCMessage shcMessage = new SHCMessage(message, packet);
List<Type> values = shcMessage.getData().getOpenHABTypes();
assertEquals(131071, ((DecimalType) values.get(0)).intValue());
assertEquals(32767, ((DecimalType) values.get(1)).intValue());
}
use of org.openhab.core.library.types.DecimalType 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());
}
use of org.openhab.core.library.types.DecimalType 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());
}
use of org.openhab.core.library.types.DecimalType 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());
}
use of org.openhab.core.library.types.DecimalType 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());
}
Aggregations