Skip to content

Commit 736e79f

Browse files
committed
Added a brief documentation
Made it compilable with latest 1.x addons repo
1 parent 794b572 commit 736e79f

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
11
# 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+
```

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.openhab.bundles</groupId>
77
<artifactId>binding</artifactId>
8-
<version>1.9.0-SNAPSHOT</version>
8+
<version>1.10.0-SNAPSHOT</version>
99
</parent>
1010

1111
<properties>

src/main/java/org/openhab/binding/yeelight/internal/YeelightGenericBindingProvider.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import org.openhab.binding.yeelight.YeelightBindingProvider;
1212
import org.openhab.core.items.Item;
13+
import org.openhab.core.library.items.ColorItem;
1314
import org.openhab.core.library.items.DimmerItem;
1415
import org.openhab.core.library.items.SwitchItem;
1516
import org.openhab.model.item.binding.AbstractGenericBindingProvider;
@@ -36,10 +37,10 @@ public String getBindingType() {
3637
*/
3738
@Override
3839
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)) {
4041
throw new BindingConfigParseException("item '" + item.getName()
4142
+ "' 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");
4344
}
4445
}
4546

0 commit comments

Comments
 (0)