/**
 * Copyright (c) 2010-2017 by the respective copyright holders.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
package org.openhab.binding.sensebox.internal;

import static org.openhab.binding.sensebox.SenseBoxBindingConstants.THING_TYPE_BOX;

import java.util.Collections;
import java.util.Set;

import org.openhab.binding.sensebox.handler.SenseBoxHandler;
import org.eclipse.smarthome.core.thing.Thing;
import org.eclipse.smarthome.core.thing.ThingTypeUID;
import org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory;
import org.eclipse.smarthome.core.thing.binding.ThingHandler;
import org.osgi.service.component.annotations.Component;

/**
 * The {@link SenseBoxHandlerFactory} is responsible for creating things and thing
 * handlers.
 *
 * @author Hakan Tandogan - Initial contribution
 */
@Component(service = BaseThingHandlerFactory.class, immediate = true, configurationPid = "binding.sensebox")
public class SenseBoxHandlerFactory extends BaseThingHandlerFactory {

    private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.singleton(THING_TYPE_BOX);

    @Override
    public boolean supportsThingType(ThingTypeUID thingTypeUID) {
        return SUPPORTED_THING_TYPES_UIDS.contains(thingTypeUID);
    }

    @Override
    protected ThingHandler createHandler(Thing thing) {

        ThingTypeUID thingTypeUID = thing.getThingTypeUID();

        if (thingTypeUID.equals(THING_TYPE_BOX)) {
            return new SenseBoxHandler(thing);
        }

        return null;
    }
}

@@ -812,52 +812,188 @@
 org.
-osgi.service.component.annotations.Component
+eclipse.smarthome.core.thing.binding.ThingHandlerFactory;%0Aimport org.osgi.service.component.annotations.Component;%0Aimport org.osgi.service.component.annotations.ConfigurationPolicy
 ;%0A%0A/
@@ -1168,20 +1168,16 @@
 rvice = 
-Base
 ThingHan
@@ -1250,16 +1250,68 @@
 ensebox%22
+, configurationPolicy = ConfigurationPolicy.OPTIONAL
 )%0Apublic

Use the proper service class in the DS component configuration (#2594)