use of org.eclipse.smarthome.binding.digitalstrom.handler.CircuitHandler in project smarthome by eclipse.
the class DigitalSTROMHandlerFactory method createHandler.
@Override
protected ThingHandler createHandler(Thing thing) {
ThingTypeUID thingTypeUID = thing.getThingTypeUID();
if (thingTypeUID == null) {
return null;
}
if (BridgeHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) {
BridgeHandler handler = new BridgeHandler((Bridge) thing);
if (bridgeHandlers == null) {
bridgeHandlers = new HashMap<ThingUID, BridgeHandler>();
}
bridgeHandlers.put(thing.getUID(), handler);
DiscoveryServiceManager discoveryServiceManager = new DiscoveryServiceManager(handler);
discoveryServiceManager.registerDiscoveryServices(bundleContext);
discoveryServiceManagers.put(handler.getThing().getUID().getAsString(), discoveryServiceManager);
return handler;
}
if (DeviceHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) {
return new DeviceHandler(thing);
}
if (CircuitHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) {
return new CircuitHandler(thing);
}
if (ZoneTemperatureControlHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) {
return new ZoneTemperatureControlHandler(thing);
}
if (SceneHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) {
return new SceneHandler(thing);
}
return null;
}
Aggregations