Search in sources :

Example 1 with DimmerThingHandler

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

the class DimmerThingHandlerTest 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);
    dimmerThing = ThingBuilder.create(THING_TYPE_DIMMER, "testdimmer").withLabel("Dimmer Thing").withBridge(bridge.getUID()).withConfiguration(new Configuration(thingProperties)).withChannel(ChannelBuilder.create(CHANNEL_UID_BRIGHTNESS, "Brightness").withType(BRIGHTNESS_CHANNEL_TYPEUID).build()).build();
    dimmerThingHandler = new DimmerThingHandler(dimmerThing) {

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

Example 2 with DimmerThingHandler

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

the class DmxChannelTest method setup.

@Before
public void setup() {
    dimmerThingHandler = Mockito.mock(DimmerThingHandler.class);
    dmxChannel = new DmxChannel(0, 1, 0);
    dmxChannel.addListener(valueChannelUID, dimmerThingHandler, ListenerType.VALUE);
    dmxChannel.setValue(0);
    currentTime = System.currentTimeMillis();
}
Also used : DmxChannel(org.eclipse.smarthome.binding.dmx.internal.multiverse.DmxChannel) DimmerThingHandler(org.eclipse.smarthome.binding.dmx.handler.DimmerThingHandler) Before(org.junit.Before)

Example 3 with DimmerThingHandler

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

the class DimmerThingHandlerTest method testThingStatus_noBridge.

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

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

Aggregations

DimmerThingHandler (org.eclipse.smarthome.binding.dmx.handler.DimmerThingHandler)3 Before (org.junit.Before)2 Nullable (org.eclipse.jdt.annotation.Nullable)1 DmxChannel (org.eclipse.smarthome.binding.dmx.internal.multiverse.DmxChannel)1 Configuration (org.eclipse.smarthome.config.core.Configuration)1 Bridge (org.eclipse.smarthome.core.thing.Bridge)1 Test (org.junit.Test)1