use of org.opencean.core.common.values.NumberWithUnit in project openhab1-addons by openhab.
the class TemperatureSensorTest method testReceiveTempertureUpdate.
@Test
public void testReceiveTempertureUpdate() {
parameterAddress = new EnoceanParameterAddress(EnoceanId.fromString(EnoceanBindingProviderMock.DEVICE_ID), Parameter.TEMPERATURE);
provider.setParameterAddress(parameterAddress);
binding.addBindingProvider(provider);
provider.setItem(new NumberItem("dummie"));
BigDecimal temperature = new BigDecimal("20.3");
binding.valueChanged(parameterAddress, new NumberWithUnit(Unit.DEGREE_CELSIUS, temperature));
assertEquals("Update State", new DecimalType(temperature), publisher.getUpdateState());
}
Aggregations