Search in sources :

Example 6 with HSBK

use of org.eclipse.smarthome.binding.lifx.internal.fields.HSBK in project smarthome by eclipse.

the class LifxLightHandler method handleIncreaseDecreaseCommand.

private void handleIncreaseDecreaseCommand(IncreaseDecreaseType increaseDecrease) {
    HSBK baseColor = getLightStateForCommand().getNullSafeColor();
    PercentType newBrightness = increaseDecreasePercentType(increaseDecrease, baseColor.getHSB().getBrightness());
    handlePercentCommand(newBrightness);
}
Also used : HSBK(org.eclipse.smarthome.binding.lifx.internal.fields.HSBK) PercentType(org.eclipse.smarthome.core.library.types.PercentType) LifxMessageUtil.increaseDecreasePercentType(org.eclipse.smarthome.binding.lifx.internal.util.LifxMessageUtil.increaseDecreasePercentType)

Example 7 with HSBK

use of org.eclipse.smarthome.binding.lifx.internal.fields.HSBK in project smarthome by eclipse.

the class LifxLightHandler method handleTemperatureCommand.

private void handleTemperatureCommand(PercentType temperature) {
    HSBK newColor = getLightStateForCommand().getNullSafeColor();
    newColor.setSaturation(PercentType.ZERO);
    newColor.setTemperature(temperature);
    getLightStateForCommand().setColor(newColor);
}
Also used : HSBK(org.eclipse.smarthome.binding.lifx.internal.fields.HSBK)

Example 8 with HSBK

use of org.eclipse.smarthome.binding.lifx.internal.fields.HSBK in project smarthome by eclipse.

the class LifxLightState method setBrightness.

public void setBrightness(PercentType brightness) {
    HSBK[] newColors = getNullSafeColors();
    for (HSBK newColor : newColors) {
        newColor.setBrightness(brightness);
    }
    setColors(newColors);
}
Also used : HSBK(org.eclipse.smarthome.binding.lifx.internal.fields.HSBK)

Example 9 with HSBK

use of org.eclipse.smarthome.binding.lifx.internal.fields.HSBK in project smarthome by eclipse.

the class LifxLightState method setTemperature.

public void setTemperature(PercentType temperature, int zoneIndex) {
    HSBK newColor = getNullSafeColor(zoneIndex);
    newColor.setTemperature(temperature);
    setColor(newColor, zoneIndex);
}
Also used : HSBK(org.eclipse.smarthome.binding.lifx.internal.fields.HSBK)

Example 10 with HSBK

use of org.eclipse.smarthome.binding.lifx.internal.fields.HSBK in project smarthome by eclipse.

the class LifxLightState method setColor.

public void setColor(HSBType newHSB) {
    HSBK newColor = getNullSafeColor();
    newColor.setHSB(newHSB);
    setColor(newColor);
}
Also used : HSBK(org.eclipse.smarthome.binding.lifx.internal.fields.HSBK)

Aggregations

HSBK (org.eclipse.smarthome.binding.lifx.internal.fields.HSBK)10 LifxMessageUtil.increaseDecreasePercentType (org.eclipse.smarthome.binding.lifx.internal.util.LifxMessageUtil.increaseDecreasePercentType)2 PercentType (org.eclipse.smarthome.core.library.types.PercentType)2