Search in sources :

Example 26 with Bridge

use of org.eclipse.smarthome.core.thing.Bridge in project smarthome by eclipse.

the class HueLightHandler method getHueBridgeHandler.

@Nullable
private synchronized HueBridgeHandler getHueBridgeHandler() {
    if (this.bridgeHandler == null) {
        Bridge bridge = getBridge();
        if (bridge == null) {
            return null;
        }
        ThingHandler handler = bridge.getHandler();
        if (handler instanceof HueBridgeHandler) {
            this.bridgeHandler = (HueBridgeHandler) handler;
            this.bridgeHandler.registerLightStatusListener(this);
        } else {
            return null;
        }
    }
    return this.bridgeHandler;
}
Also used : BaseThingHandler(org.eclipse.smarthome.core.thing.binding.BaseThingHandler) ThingHandler(org.eclipse.smarthome.core.thing.binding.ThingHandler) HueBridge(org.eclipse.smarthome.binding.hue.internal.HueBridge) Bridge(org.eclipse.smarthome.core.thing.Bridge) Nullable(org.eclipse.jdt.annotation.Nullable)

Aggregations

Bridge (org.eclipse.smarthome.core.thing.Bridge)26 Configuration (org.eclipse.smarthome.config.core.Configuration)9 ChannelUID (org.eclipse.smarthome.core.thing.ChannelUID)9 BaseThingHandler (org.eclipse.smarthome.core.thing.binding.BaseThingHandler)9 ThingHandler (org.eclipse.smarthome.core.thing.binding.ThingHandler)9 DmxBridgeHandler (org.eclipse.smarthome.binding.dmx.internal.DmxBridgeHandler)7 Nullable (org.eclipse.jdt.annotation.Nullable)6 Thing (org.eclipse.smarthome.core.thing.Thing)6 BaseDmxChannel (org.eclipse.smarthome.binding.dmx.internal.multiverse.BaseDmxChannel)5 Semaphore (java.util.concurrent.Semaphore)3 ValueSet (org.eclipse.smarthome.binding.dmx.internal.ValueSet)3 BaseBridgeHandler (org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler)3 Command (org.eclipse.smarthome.core.types.Command)3 JavaOSGiTest (org.eclipse.smarthome.test.java.JavaOSGiTest)3 Before (org.junit.Before)3 Test (org.junit.Test)3 HueBridge (org.eclipse.smarthome.binding.hue.internal.HueBridge)2 ThingUID (org.eclipse.smarthome.core.thing.ThingUID)2 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1