Package org.openhab.binding.homematic.internal.converter.state

Examples of org.openhab.binding.homematic.internal.converter.state.DecimalTypeConverter.convertFromBinding()


  }

  @Test
  public void testDecimalTypeConverterFromBinding() throws Exception {
    DecimalTypeConverter converter = new DecimalTypeConverter();
    Assert.assertEquals(new DecimalType(1), converter.convertFromBinding(getDatapoint("PRESS_SHORT", 1)));
    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("PRESS_SHORT", 0)));

    Assert.assertEquals(new DecimalType(1), converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0, 1)));
    Assert.assertEquals(new DecimalType(5), converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0, 5)));
    Assert.assertEquals(new DecimalType(5.4).doubleValue(),
View Full Code Here


  @Test
  public void testDecimalTypeConverterFromBinding() throws Exception {
    DecimalTypeConverter converter = new DecimalTypeConverter();
    Assert.assertEquals(new DecimalType(1), converter.convertFromBinding(getDatapoint("PRESS_SHORT", 1)));
    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("PRESS_SHORT", 0)));

    Assert.assertEquals(new DecimalType(1), converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0, 1)));
    Assert.assertEquals(new DecimalType(5), converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0, 5)));
    Assert.assertEquals(new DecimalType(5.4).doubleValue(),
        converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0.0, 5.4)).doubleValue());
View Full Code Here

  public void testDecimalTypeConverterFromBinding() throws Exception {
    DecimalTypeConverter converter = new DecimalTypeConverter();
    Assert.assertEquals(new DecimalType(1), converter.convertFromBinding(getDatapoint("PRESS_SHORT", 1)));
    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("PRESS_SHORT", 0)));

    Assert.assertEquals(new DecimalType(1), converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0, 1)));
    Assert.assertEquals(new DecimalType(5), converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0, 5)));
    Assert.assertEquals(new DecimalType(5.4).doubleValue(),
        converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0.0, 5.4)).doubleValue());
    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("PRESS_SHORT", false, 0, 1)));
View Full Code Here

    DecimalTypeConverter converter = new DecimalTypeConverter();
    Assert.assertEquals(new DecimalType(1), converter.convertFromBinding(getDatapoint("PRESS_SHORT", 1)));
    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("PRESS_SHORT", 0)));

    Assert.assertEquals(new DecimalType(1), converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0, 1)));
    Assert.assertEquals(new DecimalType(5), converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0, 5)));
    Assert.assertEquals(new DecimalType(5.4).doubleValue(),
        converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0.0, 5.4)).doubleValue());
    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("PRESS_SHORT", false, 0, 1)));

    Assert.assertEquals(new DecimalType(1), converter.convertFromBinding(getDatapoint("SENSOR", 1)));
View Full Code Here

    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("PRESS_SHORT", 0)));

    Assert.assertEquals(new DecimalType(1), converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0, 1)));
    Assert.assertEquals(new DecimalType(5), converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0, 5)));
    Assert.assertEquals(new DecimalType(5.4).doubleValue(),
        converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0.0, 5.4)).doubleValue());
    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("PRESS_SHORT", false, 0, 1)));

    Assert.assertEquals(new DecimalType(1), converter.convertFromBinding(getDatapoint("SENSOR", 1)));
    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("SENSOR", 0)));
View Full Code Here

    Assert.assertEquals(new DecimalType(1), converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0, 1)));
    Assert.assertEquals(new DecimalType(5), converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0, 5)));
    Assert.assertEquals(new DecimalType(5.4).doubleValue(),
        converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0.0, 5.4)).doubleValue());
    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("PRESS_SHORT", false, 0, 1)));

    Assert.assertEquals(new DecimalType(1), converter.convertFromBinding(getDatapoint("SENSOR", 1)));
    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("SENSOR", 0)));

    Assert.assertEquals(new DecimalType(1.0).doubleValue(), converter
View Full Code Here

    Assert.assertEquals(new DecimalType(5), converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0, 5)));
    Assert.assertEquals(new DecimalType(5.4).doubleValue(),
        converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0.0, 5.4)).doubleValue());
    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("PRESS_SHORT", false, 0, 1)));

    Assert.assertEquals(new DecimalType(1), converter.convertFromBinding(getDatapoint("SENSOR", 1)));
    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("SENSOR", 0)));

    Assert.assertEquals(new DecimalType(1.0).doubleValue(), converter
        .convertFromBinding(getDatapoint("LEVEL", 1.0)).doubleValue());
    Assert.assertEquals(new DecimalType(3.4).doubleValue(), converter
View Full Code Here

    Assert.assertEquals(new DecimalType(5.4).doubleValue(),
        converter.convertFromBinding(getDatapoint("PRESS_SHORT", true, 0.0, 5.4)).doubleValue());
    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("PRESS_SHORT", false, 0, 1)));

    Assert.assertEquals(new DecimalType(1), converter.convertFromBinding(getDatapoint("SENSOR", 1)));
    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("SENSOR", 0)));

    Assert.assertEquals(new DecimalType(1.0).doubleValue(), converter
        .convertFromBinding(getDatapoint("LEVEL", 1.0)).doubleValue());
    Assert.assertEquals(new DecimalType(3.4).doubleValue(), converter
        .convertFromBinding(getDatapoint("LEVEL", 3.4)).doubleValue());
View Full Code Here

    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("PRESS_SHORT", false, 0, 1)));

    Assert.assertEquals(new DecimalType(1), converter.convertFromBinding(getDatapoint("SENSOR", 1)));
    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("SENSOR", 0)));

    Assert.assertEquals(new DecimalType(1.0).doubleValue(), converter
        .convertFromBinding(getDatapoint("LEVEL", 1.0)).doubleValue());
    Assert.assertEquals(new DecimalType(3.4).doubleValue(), converter
        .convertFromBinding(getDatapoint("LEVEL", 3.4)).doubleValue());

    Assert.assertEquals(new DecimalType(9876.678957).doubleValue(),
View Full Code Here

    Assert.assertEquals(new DecimalType(1), converter.convertFromBinding(getDatapoint("SENSOR", 1)));
    Assert.assertEquals(new DecimalType(0), converter.convertFromBinding(getDatapoint("SENSOR", 0)));

    Assert.assertEquals(new DecimalType(1.0).doubleValue(), converter
        .convertFromBinding(getDatapoint("LEVEL", 1.0)).doubleValue());
    Assert.assertEquals(new DecimalType(3.4).doubleValue(), converter
        .convertFromBinding(getDatapoint("LEVEL", 3.4)).doubleValue());

    Assert.assertEquals(new DecimalType(9876.678957).doubleValue(),
        converter.convertFromBinding(getDatapoint("LEVEL", 9876.6789568)).doubleValue());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.