use of org.openhab.binding.kodi.internal.handler.KodiHandler in project openhab-addons by openhab.
the class KodiHandlerFactory method createHandler.
@Override
@Nullable
protected ThingHandler createHandler(Thing thing) {
ThingTypeUID thingTypeUID = thing.getThingTypeUID();
if (thingTypeUID.equals(THING_TYPE_KODI)) {
String callbackUrl = createCallbackUrl();
KodiHandler handler = new KodiHandler(thing, commandDescriptionProvider, stateDescriptionProvider, webSocketClient, callbackUrl);
// register the Kodi as an audio sink
KodiAudioSink audioSink = new KodiAudioSink(handler, audioHTTPServer, callbackUrl);
@SuppressWarnings("unchecked") ServiceRegistration<AudioSink> reg = (ServiceRegistration<AudioSink>) bundleContext.registerService(AudioSink.class.getName(), audioSink, new Hashtable<>());
audioSinkRegistrations.put(thing.getUID().toString(), reg);
return handler;
}
return null;
}
Aggregations