2 * Copyright (c) 2010-2022 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.milight.internal.handler;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.milight.internal.MilightThingState;
19 * The {@link LedHandlerInterface} defines the general interface for all Milight bulbs.
20 * The different versions might support additional functionality.
22 * @author David Graeff - Initial contribution
25 public interface LedHandlerInterface {
27 * Set the color value of this bulb.
29 * @param hue A value from 0 to 360
30 * @param saturation A saturation value. Can be -1 if not known
31 * @param brightness A brightness value. Can be -1 if not known
32 * @param state The changed values will be written back to the state
34 void setHSB(int hue, int saturation, int brightness, MilightThingState state);
37 * Enable/Disable the bulb.
40 * @param state The changed values will be written back to the state
42 void setPower(boolean on, MilightThingState state);
45 * Switches to white mode (disables color leds).
47 * @param state The changed values will be written back to the state
49 void whiteMode(MilightThingState state);
52 * Switches to night mode (low current for all leds).
54 * @param state The changed values will be written back to the state
56 void nightMode(MilightThingState state);
59 * Sets the color temperature of the bulb.
61 * @param colorTemp Color temperature percentage
62 * @param state The changed values will be written back to the state
64 void setColorTemperature(int colorTemp, MilightThingState state);
66 void changeColorTemperature(int colorTempRelative, MilightThingState state);
69 * Sets the brightness of the bulb.
71 * @param value brightness percentage
72 * @param state The changed values will be written back to the state
74 void setBrightness(int value, MilightThingState state);
76 void changeBrightness(int relativeBrightness, MilightThingState state);
78 void setSaturation(int value, MilightThingState state);
80 void changeSaturation(int relativeSaturation, MilightThingState state);
82 void setLedMode(int mode, MilightThingState state);
84 void previousAnimationMode(MilightThingState state);
86 void nextAnimationMode(MilightThingState state);
88 void changeSpeed(int relativeSpeed, MilightThingState state);