Search in sources :

Example 1 with TradfriControllerHandler

use of org.eclipse.smarthome.binding.tradfri.handler.TradfriControllerHandler in project smarthome by eclipse.

the class TradfriHandlerFactory method createHandler.

@Override
protected ThingHandler createHandler(Thing thing) {
    ThingTypeUID thingTypeUID = thing.getThingTypeUID();
    if (GATEWAY_TYPE_UID.equals(thingTypeUID)) {
        TradfriGatewayHandler handler = new TradfriGatewayHandler((Bridge) thing);
        registerDiscoveryService(handler);
        return handler;
    } else if (THING_TYPE_DIMMER.equals(thingTypeUID) || THING_TYPE_REMOTE_CONTROL.equals(thingTypeUID)) {
        return new TradfriControllerHandler(thing);
    } else if (THING_TYPE_MOTION_SENSOR.equals(thingTypeUID)) {
        return new TradfriSensorHandler(thing);
    } else if (SUPPORTED_LIGHT_TYPES_UIDS.contains(thingTypeUID)) {
        return new TradfriLightHandler(thing);
    }
    return null;
}
Also used : TradfriControllerHandler(org.eclipse.smarthome.binding.tradfri.handler.TradfriControllerHandler) TradfriSensorHandler(org.eclipse.smarthome.binding.tradfri.handler.TradfriSensorHandler) TradfriLightHandler(org.eclipse.smarthome.binding.tradfri.handler.TradfriLightHandler) TradfriGatewayHandler(org.eclipse.smarthome.binding.tradfri.handler.TradfriGatewayHandler) ThingTypeUID(org.eclipse.smarthome.core.thing.ThingTypeUID)

Aggregations

TradfriControllerHandler (org.eclipse.smarthome.binding.tradfri.handler.TradfriControllerHandler)1 TradfriGatewayHandler (org.eclipse.smarthome.binding.tradfri.handler.TradfriGatewayHandler)1 TradfriLightHandler (org.eclipse.smarthome.binding.tradfri.handler.TradfriLightHandler)1 TradfriSensorHandler (org.eclipse.smarthome.binding.tradfri.handler.TradfriSensorHandler)1 ThingTypeUID (org.eclipse.smarthome.core.thing.ThingTypeUID)1