@Test
 public void testGetParameterAddress() throws BindingConfigParseException {
   EnoceanGenericBindingProvider provider = new EnoceanGenericBindingProvider();
   provider.processBindingConfiguration(
       "enocean",
       new TestItem("item"),
       "{id=00:8B:62:43, eep=F6:02:01, channel=B, parameter=I_PRESSED}");
   assertEquals(
       new EnoceanParameterAddress(EnoceanId.fromString("00:8B:62:43"), "B", "I_PRESSED"),
       provider.getParameterAddress("item"));
 }
Ejemplo n.º 2
0
 @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());
 }