Package org.openhab.core.library.types

Examples of org.openhab.core.library.types.DecimalType.doubleValue()


    DecimalType value = (DecimalType) item.getStateAs(DecimalType.class);
    if (value == null) {
      value = DecimalType.ZERO;
    }
   
    double average = value.doubleValue();
    int quantity = 1;
    while(it.hasNext()) {
      State state = it.next().getState();
      if (state instanceof DecimalType) {
        value = (DecimalType) state;
View Full Code Here


    int quantity = 1;
    while(it.hasNext()) {
      State state = it.next().getState();
      if (state instanceof DecimalType) {
        value = (DecimalType) state;
        average += value.doubleValue();
        quantity++;
      }
    }
    average /= quantity;
   
View Full Code Here

    if (command instanceof HSBType) {
      HSBType hsbCommand = (HSBType) command;
      DecimalType hue = hsbCommand.getHue();
      PercentType sat = hsbCommand.getSaturation();
      PercentType bri = hsbCommand.getBrightness();
      bulb.colorizeByHSB(hue.doubleValue() / 360,
          sat.doubleValue() / 100, bri.doubleValue() / 100);
    }

    if (deviceConfig.getType().equals(BindingType.brightness)
        || deviceConfig.getType().equals(BindingType.rgb)) {
View Full Code Here

          decimalType = (DecimalType) command;
        } else if (command instanceof OnOffType) {
          decimalType = OnOffType.ON.equals(command) ? DEFAULT_ON_TEMPERATURE : DEFAULT_OFF_TEMPERATURE;
        }

        S_Command cmd = new S_Command(rfAddress, device.getRoomId(), decimalType.doubleValue());
        commandString = cmd.getCommandString();
      } else if (command instanceof StringType) {
        String commandContent = command.toString().trim().toUpperCase();
        ThermostatModeType commandThermoType = null;
        if (commandContent.contentEquals(ThermostatModeType.AUTOMATIC.toString())) {
View Full Code Here

      double qtop = sortedList.get(sortedList.getNtile(NTILE - 1, NTILE)).doubleValue();
      double r = qtop - qbottom; // range
      double lowerbound = qbottom - ALPHA * r;
      double upperbound = qtop + ALPHA * r;
      // box it
      double yd = y.doubleValue();
      yd = Math.max(yd,  lowerbound);
      yd = Math.min(yd,  upperbound);
      if (yd != y.doubleValue()) {
        logger.debug("boxed outlier: range: {}-{}={} orig data: {} filt data: {}",
            qbottom, qtop, qtop - qbottom, v.doubleValue(), yd);
View Full Code Here

      double upperbound = qtop + ALPHA * r;
      // box it
      double yd = y.doubleValue();
      yd = Math.max(yd,  lowerbound);
      yd = Math.min(yd,  upperbound);
      if (yd != y.doubleValue()) {
        logger.debug("boxed outlier: range: {}-{}={} orig data: {} filt data: {}",
            qbottom, qtop, qtop - qbottom, v.doubleValue(), yd);
      }
      y = new DecimalType(yd);
    }
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.