Skip to content

Commit

Permalink
[yeelight] Fixed ceiling3 device being recognized as device without n…
Browse files Browse the repository at this point in the history
…ightmode (openhab#11876)

Signed-off-by: Ondrej Pecta <opecta@gmail.com>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
  • Loading branch information
octa22 authored and andrasU committed Nov 12, 2022
1 parent 3363843 commit b19fc9b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
Expand Up @@ -67,10 +67,9 @@ protected ThingHandler createHandler(Thing thing) {
return new YeelightColorHandler(thing);
} else if (thingTypeUID.equals(THING_TYPE_STRIPE)) {
return new YeelightStripeHandler(thing);
} else if (thingTypeUID.equals(THING_TYPE_CEILING) || thingTypeUID.equals(THING_TYPE_CEILING3)
|| thingTypeUID.equals(THING_TYPE_DESKLAMP)) {
} else if (thingTypeUID.equals(THING_TYPE_CEILING) || thingTypeUID.equals(THING_TYPE_DESKLAMP)) {
return new YeelightCeilingHandler(thing);
} else if (thingTypeUID.equals(THING_TYPE_CEILING1)) {
} else if (thingTypeUID.equals(THING_TYPE_CEILING1) || thingTypeUID.equals(THING_TYPE_CEILING3)) {
return new YeelightCeilingWithNightHandler(thing);
} else if (thingTypeUID.equals(THING_TYPE_CEILING4)) {
return new YeelightCeilingWithAmbientHandler(thing);
Expand Down
Expand Up @@ -34,9 +34,9 @@ public static DeviceBase build(String model, String id) {
DeviceType type = DeviceType.valueOf(model);
switch (type) {
case ceiling:
case ceiling3:
return new CeilingDevice(id);
case ceiling1:
case ceiling3:
return new CeilingDeviceWithNightDevice(id);
case ceiling4:
return new CeilingDeviceWithAmbientDevice(id);
Expand Down
Expand Up @@ -332,9 +332,9 @@ public static String getDefaultName(DeviceBase device) {
}
switch (device.getDeviceType()) {
case ceiling:
case ceiling3:
return "Yeelight LED Ceiling";
case ceiling1:
case ceiling3:
return "Yeelight LED Ceiling with night mode";
case ceiling4:
return "Yeelight LED Ceiling with ambient light";
Expand Down
Expand Up @@ -51,7 +51,7 @@ public class YeelightHandlerFactoryTest {
private static final List<Object[]> TESTS = Arrays.asList(
new Object[][] { { "dolphin", YeelightWhiteHandler.class }, { "ct_bulb", YeelightWhiteHandler.class },
{ "wonder", YeelightColorHandler.class }, { "stripe", YeelightStripeHandler.class },
{ "ceiling", YeelightCeilingHandler.class }, { "ceiling3", YeelightCeilingHandler.class },
{ "ceiling", YeelightCeilingHandler.class }, { "ceiling3", YeelightCeilingWithNightHandler.class },
{ "ceiling1", YeelightCeilingWithNightHandler.class }, { "desklamp", YeelightCeilingHandler.class },
{ "ceiling4", YeelightCeilingWithAmbientHandler.class }, { "unknown", null } });

Expand Down

0 comments on commit b19fc9b

Please sign in to comment.