Search in sources :

Example 1 with MoonHandler

use of org.eclipse.smarthome.binding.astro.handler.MoonHandler in project smarthome by eclipse.

the class AstroHandlerFactory method createHandler.

@Override
protected ThingHandler createHandler(Thing thing) {
    ThingTypeUID thingTypeUID = thing.getThingTypeUID();
    AstroThingHandler thingHandler = null;
    if (thingTypeUID.equals(THING_TYPE_SUN)) {
        thingHandler = new SunHandler(thing);
    } else if (thingTypeUID.equals(THING_TYPE_MOON)) {
        thingHandler = new MoonHandler(thing);
    }
    if (thingHandler != null) {
        ASTRO_THING_HANDLERS.put(thing.getUID().toString(), thingHandler);
    }
    return thingHandler;
}
Also used : AstroThingHandler(org.eclipse.smarthome.binding.astro.handler.AstroThingHandler) SunHandler(org.eclipse.smarthome.binding.astro.handler.SunHandler) ThingTypeUID(org.eclipse.smarthome.core.thing.ThingTypeUID) MoonHandler(org.eclipse.smarthome.binding.astro.handler.MoonHandler)

Aggregations

AstroThingHandler (org.eclipse.smarthome.binding.astro.handler.AstroThingHandler)1 MoonHandler (org.eclipse.smarthome.binding.astro.handler.MoonHandler)1 SunHandler (org.eclipse.smarthome.binding.astro.handler.SunHandler)1 ThingTypeUID (org.eclipse.smarthome.core.thing.ThingTypeUID)1