Search in sources :

Example 1 with TunableWhiteThingHandler

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

the class TunableWhiteThingHandlerTest method testThingStatus_noBridge.

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

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

Example 2 with TunableWhiteThingHandler

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

the class TunableWhiteThingHandlerTest 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, "127,127");
    dimmerThing = ThingBuilder.create(THING_TYPE_TUNABLEWHITE, "testdimmer").withLabel("Dimmer Thing").withBridge(bridge.getUID()).withConfiguration(new Configuration(thingProperties)).withChannel(ChannelBuilder.create(CHANNEL_UID_BRIGHTNESS, "Brightness").withType(BRIGHTNESS_CHANNEL_TYPEUID).build()).withChannel(ChannelBuilder.create(CHANNEL_UID_BRIGHTNESS_CW, "Brightness CW").withType(BRIGHTNESS_CHANNEL_TYPEUID).build()).withChannel(ChannelBuilder.create(CHANNEL_UID_BRIGHTNESS_WW, "Brightness WW").withType(BRIGHTNESS_CHANNEL_TYPEUID).build()).withChannel(ChannelBuilder.create(CHANNEL_UID_COLOR_TEMP, "Color temperature").withType(COLOR_TEMPERATURE_CHANNEL_TYPEUID).build()).build();
    dimmerThingHandler = new TunableWhiteThingHandler(dimmerThing) {

        @Override
        @Nullable
        protected Bridge getBridge() {
            return bridge;
        }
    };
    initializeHandler(dimmerThingHandler);
}
Also used : TunableWhiteThingHandler(org.eclipse.smarthome.binding.dmx.handler.TunableWhiteThingHandler) 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

TunableWhiteThingHandler (org.eclipse.smarthome.binding.dmx.handler.TunableWhiteThingHandler)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