Search in sources :

Example 1 with ColorThingHandler

use of org.eclipse.smarthome.binding.dmx.handler.ColorThingHandler in project smarthome by eclipse.

the class ColorThingHandlerTest method testThingStatus_noBridge.

@Test
public void testThingStatus_noBridge() {
    // check that thing is offline if no bridge found
    ColorThingHandler dimmerHandlerWithoutBridge = new ColorThingHandler(dimmerThing) {

        @Override
        @Nullable
        protected Bridge getBridge() {
            return null;
        }
    };
    assertThingStatusWithoutBridge(dimmerHandlerWithoutBridge);
}
Also used : ColorThingHandler(org.eclipse.smarthome.binding.dmx.handler.ColorThingHandler) Test(org.junit.Test)

Example 2 with ColorThingHandler

use of org.eclipse.smarthome.binding.dmx.handler.ColorThingHandler in project smarthome by eclipse.

the class ColorThingHandlerTest method setUp.

@Before
public void setUp() {
    super.setup();
    thingProperties = new HashMap<>();
    thingProperties.put(CONFIG_DMX_ID, TEST_CHANNEL_CONFIG);
    thingProperties.put(CONFIG_DIMMER_FADE_TIME, TEST_FADE_TIME);
    thingProperties.put(CONFIG_DIMMER_TURNONVALUE, "255,128,0");
    dimmerThing = ThingBuilder.create(THING_TYPE_COLOR, "testdimmer").withLabel("Dimmer Thing").withBridge(bridge.getUID()).withConfiguration(new Configuration(thingProperties)).withChannel(ChannelBuilder.create(CHANNEL_UID_BRIGHTNESS_R, "Brightness R").withType(BRIGHTNESS_CHANNEL_TYPEUID).build()).withChannel(ChannelBuilder.create(CHANNEL_UID_BRIGHTNESS_G, "Brightness G").withType(BRIGHTNESS_CHANNEL_TYPEUID).build()).withChannel(ChannelBuilder.create(CHANNEL_UID_BRIGHTNESS_B, "Brightness B").withType(BRIGHTNESS_CHANNEL_TYPEUID).build()).withChannel(ChannelBuilder.create(CHANNEL_UID_COLOR, "Color").withType(COLOR_CHANNEL_TYPEUID).build()).build();
    dimmerThingHandler = new ColorThingHandler(dimmerThing) {

        @Override
        @Nullable
        protected Bridge getBridge() {
            return bridge;
        }
    };
    initializeHandler(dimmerThingHandler);
}
Also used : ColorThingHandler(org.eclipse.smarthome.binding.dmx.handler.ColorThingHandler) Configuration(org.eclipse.smarthome.config.core.Configuration) Nullable(org.eclipse.jdt.annotation.Nullable) Bridge(org.eclipse.smarthome.core.thing.Bridge) Before(org.junit.Before)

Aggregations

ColorThingHandler (org.eclipse.smarthome.binding.dmx.handler.ColorThingHandler)2 Nullable (org.eclipse.jdt.annotation.Nullable)1 Configuration (org.eclipse.smarthome.config.core.Configuration)1 Bridge (org.eclipse.smarthome.core.thing.Bridge)1 Before (org.junit.Before)1 Test (org.junit.Test)1