Package org.openhab.core.library.types

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


    logger.debug("milight: sendColor");
    HSBType hsbCommand = (HSBType) command;
    DecimalType hue = hsbCommand.getHue();
   
    // we have to map [0,360] to [0,0xFF], where red equals hue=0 and the milight color 0xB0 (=176)
    Integer milightColorNo = (256 + 176 - (int) (hue.floatValue() / 360.0 * 255.0)) % 256;
    try {
      if (bulb == 5) {
        String messageBytes = "20:" + Integer.toHexString(milightColorNo) + ":55";
        sendMessage(messageBytes, bridgeId);
      }
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.