use of org.openhab.core.thing.Bridge in project openhab-addons by openhab.
the class HueGroupHandler method getHueClient.
@Nullable
protected synchronized HueClient getHueClient() {
if (hueClient == null) {
Bridge bridge = getBridge();
if (bridge == null) {
return null;
}
ThingHandler handler = bridge.getHandler();
if (handler instanceof HueBridgeHandler) {
HueClient bridgeHandler = (HueClient) handler;
hueClient = bridgeHandler;
bridgeHandler.registerGroupStatusListener(this);
} else {
return null;
}
}
return hueClient;
}
use of org.openhab.core.thing.Bridge in project openhab-addons by openhab.
the class HueLightHandler method getHueClient.
@Nullable
protected synchronized HueClient getHueClient() {
if (hueClient == null) {
Bridge bridge = getBridge();
if (bridge == null) {
return null;
}
ThingHandler handler = bridge.getHandler();
if (handler instanceof HueClient) {
HueClient bridgeHandler = (HueClient) handler;
hueClient = bridgeHandler;
bridgeHandler.registerLightStatusListener(this);
} else {
return null;
}
}
return hueClient;
}
use of org.openhab.core.thing.Bridge in project openhab-addons by openhab.
the class HueSensorHandler method initialize.
@Override
public void initialize() {
logger.debug("Initializing hue sensor handler.");
Bridge bridge = getBridge();
initializeThing((bridge == null) ? null : bridge.getStatus());
}
use of org.openhab.core.thing.Bridge in project openhab-addons by openhab.
the class HueSensorHandler method getHueClient.
@Nullable
protected synchronized HueClient getHueClient() {
if (hueClient == null) {
Bridge bridge = getBridge();
if (bridge == null) {
return null;
}
ThingHandler handler = bridge.getHandler();
if (handler instanceof HueBridgeHandler) {
HueClient bridgeHandler = (HueClient) handler;
hueClient = bridgeHandler;
bridgeHandler.registerSensorStatusListener(this);
} else {
return null;
}
}
return hueClient;
}
use of org.openhab.core.thing.Bridge in project openhab-addons by openhab.
the class InnogyDeviceHandler method getInnogyBridgeHandler.
/**
* Returns the innogy bridge handler.
*
* @return the {@link InnogyBridgeHandler} or null
*/
@Nullable
private InnogyBridgeHandler getInnogyBridgeHandler() {
synchronized (this.lock) {
if (this.bridgeHandler == null) {
@Nullable final Bridge bridge = getBridge();
if (bridge == null) {
return null;
}
@Nullable final ThingHandler handler = bridge.getHandler();
if (handler instanceof InnogyBridgeHandler) {
this.bridgeHandler = (InnogyBridgeHandler) handler;
this.bridgeHandler.registerDeviceStatusListener(this);
} else {
return null;
}
}
return this.bridgeHandler;
}
}
Aggregations