]> git.basschouten.com Git - openhab-addons.git/blob
1505d0e3bb05abce2411d04d86d089e9ee2e8c7f
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.milight.internal.handler;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.milight.internal.MilightThingState;
17
18 /**
19  * The {@link LedHandlerInterface} defines the general interface for all Milight bulbs.
20  * The different versions might support additional functionality.
21  *
22  * @author David Graeff - Initial contribution
23  */
24 @NonNullByDefault
25 public interface LedHandlerInterface {
26     /**
27      * Set the color value of this bulb.
28      *
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
33      */
34     void setHSB(int hue, int saturation, int brightness, MilightThingState state);
35
36     /**
37      * Enable/Disable the bulb.
38      *
39      * @param on On/Off
40      * @param state The changed values will be written back to the state
41      */
42     void setPower(boolean on, MilightThingState state);
43
44     /**
45      * Switches to white mode (disables color leds).
46      *
47      * @param state The changed values will be written back to the state
48      */
49     void whiteMode(MilightThingState state);
50
51     /**
52      * Switches to night mode (low current for all leds).
53      *
54      * @param state The changed values will be written back to the state
55      */
56     void nightMode(MilightThingState state);
57
58     /**
59      * Sets the color temperature of the bulb.
60      *
61      * @param colorTemp Color temperature percentage
62      * @param state The changed values will be written back to the state
63      */
64     void setColorTemperature(int colorTemp, MilightThingState state);
65
66     void changeColorTemperature(int colorTempRelative, MilightThingState state);
67
68     /**
69      * Sets the brightness of the bulb.
70      *
71      * @param value brightness percentage
72      * @param state The changed values will be written back to the state
73      */
74     void setBrightness(int value, MilightThingState state);
75
76     void changeBrightness(int relativeBrightness, MilightThingState state);
77
78     void setSaturation(int value, MilightThingState state);
79
80     void changeSaturation(int relativeSaturation, MilightThingState state);
81
82     void setLedMode(int mode, MilightThingState state);
83
84     void previousAnimationMode(MilightThingState state);
85
86     void nextAnimationMode(MilightThingState state);
87
88     void changeSpeed(int relativeSpeed, MilightThingState state);
89 }