Examples of DecimalType


Examples of org.openhab.core.library.types.DecimalType

   *
   * @return
   *       the valve position as <code>DecimalType</code>
   */
  public DecimalType getValvePosition() {
    return new DecimalType(this.valvePosition);
  }
View Full Code Here

Examples of org.openhab.core.library.types.DecimalType

   *
   * @return
   *       the actual temperature as <code>DecimalType</code>
   */
  public State getTemperatureActual() {
    return new DecimalType(this.temperatureActual);
  }
View Full Code Here

Examples of org.openhab.core.library.types.DecimalType

   *
   * @return
   *       the setpoint temperature as <code>DecimalType</code>
   */
  public State getTemperatureSetpoint() {
    return new DecimalType(this.temperatureSetpoint);
  }
View Full Code Here

Examples of org.openhab.core.library.types.DecimalType

          return translatorBoolean.getValueBoolean() ? OnOffType.ON:OnOffType.OFF;
        }
      case 2:
        DPTXlator1BitControlled translator1BitControlled =  (DPTXlator1BitControlled) translator;
        int decValue= (translator1BitControlled.getControlBit() ? 2:0) + (translator1BitControlled.getValueBit() ? 1:0) ;
        return new DecimalType (decValue);
      case 3:
        DPTXlator3BitControlled translator3BitControlled = (DPTXlator3BitControlled) translator;
        if (translator3BitControlled.getStepCode()==0) {
          // Not supported: break
          logger.debug("toType: KNX DPT_Control_Dimming: break ignored.");
View Full Code Here

Examples of org.openhab.core.library.types.DecimalType

                  }
                }                 
              } else if (deviceConfig.getType().equals(BindingType.rgb)) {
                if ((bulb.getIsOn() == true) && (bulb.getIsReachable() == true)) {
                  // Only postUpdate when bulb is on, otherwise color item is not retaining state and shows to max brightness value
                  DecimalType decimalHue = new DecimalType(bulb.getHue() / (double)182);
                  PercentType percentBrightness = new PercentType((int)Math.round((bulb.getBrightness() * (double)100) / (double)255));
                  PercentType percentSaturation = new PercentType((int)Math.round((bulb.getSaturation() * (double)100) / (double)255));
                  HSBType newHsb = new HSBType(decimalHue, percentSaturation, percentBrightness);
                  if ((deviceConfig.itemStateHSBType == null) || (deviceConfig.itemStateHSBType.equals(newHsb) == false)) {
                    eventPublisher.postUpdate(hueItemName, newHsb);
View Full Code Here

Examples of org.openhab.core.library.types.DecimalType

      bulb.switchOn(OnOffType.ON.equals(command));
    }

    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

Examples of org.openhab.core.library.types.DecimalType

      throws RFXComException {
    org.openhab.core.types.State state = UnDefType.UNDEF;

    if (valueSelector.getItemClass() == NumberItem.class) {
      if (valueSelector == RFXComValueSelector.SIGNAL_LEVEL) {
        state = new DecimalType(signalLevel);
      } else {
        throw new RFXComException("Can't convert " + valueSelector
            + " to NumberItem");
      }
View Full Code Here

Examples of org.openhab.core.library.types.DecimalType

      String rfAddress = device.getRFAddress();
      String commandString = null;

      if (command instanceof DecimalType || command instanceof OnOffType) {
        DecimalType decimalType = DEFAULT_OFF_TEMPERATURE;
        if (command instanceof DecimalType) {
          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

Examples of org.openhab.core.library.types.DecimalType

  private void receivedNewValveOpening(String device, int actuatorNumber, double valve) {
    String fullAddress = device + "0" + actuatorNumber;
    FHTBindingConfig config = getConfig(fullAddress, Datapoint.VALVE);
    if (config != null) {
      logger.debug("Updating item " + config.getItem().getName() + " with new valve opening");
      DecimalType state = new DecimalType(valve);
      eventPublisher.postUpdate(config.getItem().getName(), state);
    } else {
      logger.debug("Received valve opening of unkown actuator with address " + fullAddress);
    }
  }
View Full Code Here

Examples of org.openhab.core.library.types.DecimalType

  private void receivedNewMeasuredTemperature(String deviceAddress, double temperature) {
    FHTBindingConfig config = getConfig(deviceAddress, Datapoint.MEASURED_TEMP);
    if (config != null) {
      logger.debug("Updating item " + config.getItem().getName() + " with new measured temperature "
          + temperature);
      DecimalType state = new DecimalType(temperature);
      eventPublisher.postUpdate(config.getItem().getName(), state);
    } else {
      logger.debug("Received new measured temp for unkown device with address " + deviceAddress);
    }
  }
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.