File tree 3 files changed +16
-3
lines changed
src/main/java/org/openhab/binding/yeelight/internal
3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 1
1
# org.openhab.binding.yeelight
2
+
3
+ # binding configuration
4
+ No configuration needed
5
+
6
+ # item file example
7
+ ```
8
+ Switch YeelightStrip "Yeelight LED power" { yeelight="192.168.2.43:55443" }
9
+ Switch YeelightStripToggle "Toggle Yeelight LED strip" { yeelight="192.168.2.43:55443#toggle" }
10
+ Dimmer YeelightStripBright "LED brightness [%.1f]" { yeelight="192.168.2.43:55443#set_bright" }
11
+ Dimmer YeelightStripCT "LED color temp [%.1f]" { yeelight="192.168.2.43:55443#set_ct" }
12
+ Color YeelightRGB "RGB" { yeelight="192.168.2.43:55443#set_hsb" }
13
+ ```
Original file line number Diff line number Diff line change 5
5
<parent >
6
6
<groupId >org.openhab.bundles</groupId >
7
7
<artifactId >binding</artifactId >
8
- <version >1.9 .0-SNAPSHOT</version >
8
+ <version >1.10 .0-SNAPSHOT</version >
9
9
</parent >
10
10
11
11
<properties >
Original file line number Diff line number Diff line change 10
10
11
11
import org .openhab .binding .yeelight .YeelightBindingProvider ;
12
12
import org .openhab .core .items .Item ;
13
+ import org .openhab .core .library .items .ColorItem ;
13
14
import org .openhab .core .library .items .DimmerItem ;
14
15
import org .openhab .core .library .items .SwitchItem ;
15
16
import org .openhab .model .item .binding .AbstractGenericBindingProvider ;
@@ -36,10 +37,10 @@ public String getBindingType() {
36
37
*/
37
38
@ Override
38
39
public void validateItemType (Item item , String bindingConfig ) throws BindingConfigParseException {
39
- if (!(item instanceof SwitchItem || item instanceof DimmerItem )) {
40
+ if (!(item instanceof SwitchItem || item instanceof DimmerItem || item instanceof ColorItem )) {
40
41
throw new BindingConfigParseException ("item '" + item .getName ()
41
42
+ "' is of location '" + item .getClass ().getSimpleName ()
42
- + "', only Switch- and DimmerItems are allowed - please check your *.items configuration" );
43
+ + "', only Switch-, Dimmer- and ColorItems are allowed - please check your *.items configuration" );
43
44
}
44
45
}
45
46
You can’t perform that action at this time.
0 commit comments