当前位置: 首页>>代码示例>>Java>>正文


Java Thing.getThingTypeUID方法代码示例

本文整理汇总了Java中org.eclipse.smarthome.core.thing.Thing.getThingTypeUID方法的典型用法代码示例。如果您正苦于以下问题:Java Thing.getThingTypeUID方法的具体用法?Java Thing.getThingTypeUID怎么用?Java Thing.getThingTypeUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.smarthome.core.thing.Thing的用法示例。


在下文中一共展示了Thing.getThingTypeUID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createHandler

import org.eclipse.smarthome.core.thing.Thing; //导入方法依赖的package包/类
@Override
protected ThingHandler createHandler(Thing thing) {
    ThingTypeUID thingTypeUID = thing.getThingTypeUID();

    if (thingTypeUID.equals(THING_TYPE_HOME)) {
        TadoHomeHandler tadoHomeHandler = new TadoHomeHandler((Bridge) thing);

        TadoDiscoveryService discoveryService = new TadoDiscoveryService(tadoHomeHandler);
        bundleContext.registerService(DiscoveryService.class.getName(), discoveryService,
                new Hashtable<String, Object>());

        return tadoHomeHandler;
    } else if (thingTypeUID.equals(THING_TYPE_ZONE)) {
        return new TadoZoneHandler(thing);
    } else if (thingTypeUID.equals(THING_TYPE_MOBILE_DEVICE)) {
        return new TadoMobileDeviceHandler(thing);
    }

    return null;
}
 
开发者ID:dfrommi,项目名称:openhab-tado,代码行数:21,代码来源:TadoHandlerFactory.java

示例2: createHandler

import org.eclipse.smarthome.core.thing.Thing; //导入方法依赖的package包/类
@Override
protected ThingHandler createHandler(Thing thing) {
    ThingTypeUID thingTypeUID = thing.getThingTypeUID();

    if (thingTypeUID.equals(WMBusBindingConstants.THING_TYPE_BRIDGE)) {
        // create handler for WMBus bridge
        logger.debug("Creating (handler for) WMBus bridge.");
        if (thing instanceof Bridge) {
            WMBusBridgeHandler handler = new WMBusBridgeHandler((Bridge) thing);
            registerDiscoveryService(handler);
            return handler;
        } else {
            return null;
        }
    } else if (thingTypeUID.equals(WMBusBindingConstants.THING_TYPE_TECHEM_HKV)) {
        // create handler for Techem HKV device
        logger.debug("Creating (handler for) TechemHKV device.");
        return new WMBusTechemHKVHandler(thing);
    } else {
        return null;
    }
}
 
开发者ID:pokerazor,项目名称:openhab-binding-wmbus,代码行数:23,代码来源:WMBusHandlerFactory.java

示例3: createHandler

import org.eclipse.smarthome.core.thing.Thing; //导入方法依赖的package包/类
@Override
protected ThingHandler createHandler(Thing thing) {

    ThingTypeUID thingTypeUID = thing.getThingTypeUID();

    if (thingTypeUID.equals(MegaDBindingConstants.THING_TYPE_UID_BRIDGE)) {
        MegaDBridgeHandler handler = new MegaDBridgeHandler((Bridge) thing);
        return handler;
    }

    if (supportsThingType(thingTypeUID)) {
        return new MegaDHandler(thing);
    }

    return null;
}
 
开发者ID:Pshatsillo,项目名称:openhab2MegadBinding,代码行数:17,代码来源:MegaDHandlerFactory.java

示例4: createHandler

import org.eclipse.smarthome.core.thing.Thing; //导入方法依赖的package包/类
@Override
protected ThingHandler createHandler(Thing thing) {
    ThingTypeUID thingTypeUID = thing.getThingTypeUID();

    if (thingTypeUID.equals(HarmonyHubBindingConstants.HARMONY_HUB_THING_TYPE)) {
        HarmonyHubHandler harmonyHubHandler = new HarmonyHubHandler((Bridge) thing, this);
        registerHarmonyDeviceDiscoveryService(harmonyHubHandler);
        return harmonyHubHandler;
    }

    if (thingTypeUID.equals(HarmonyHubBindingConstants.HARMONY_DEVICE_THING_TYPE)) {
        return new HarmonyDeviceHandler(thing, this);
    }

    return null;
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:17,代码来源:HarmonyHubHandlerFactory.java

示例5: createHandler

import org.eclipse.smarthome.core.thing.Thing; //导入方法依赖的package包/类
@Override
protected ThingHandler createHandler(Thing thing) {

    ThingTypeUID thingTypeUID = thing.getThingTypeUID();

    if (thingTypeUID.equals(ZoneMinderConstants.THING_TYPE_BRIDGE_ZONEMINDER_SERVER)) {

        logger.debug("[FACTORY]: creating handler for bridge thing '{}'", thing);
        ZoneMinderServerBridgeHandler bridge = new ZoneMinderServerBridgeHandler((Bridge) thing);

        return bridge;
    } else if (thingTypeUID.equals(ZoneMinderConstants.THING_TYPE_THING_ZONEMINDER_MONITOR)) {
        return new ZoneMinderThingMonitorHandler(thing);
    }

    return null;
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:18,代码来源:ZoneMinderHandlerFactory.java

示例6: createHandler

import org.eclipse.smarthome.core.thing.Thing; //导入方法依赖的package包/类
@Override
protected ThingHandler createHandler(final Thing thing) {
    ThingTypeUID thingTypeUID = thing.getThingTypeUID();

    if (SleepIQCloudHandler.SUPPORTED_THING_TYPE_UIDS.contains(thingTypeUID)) {

        logger.debug("Creating SleepIQ cloud thing handler");
        SleepIQCloudHandler cloudHandler = new SleepIQCloudHandler((Bridge) thing);
        registerBedDiscoveryService(cloudHandler);
        return cloudHandler;

    } else if (SleepIQDualBedHandler.SUPPORTED_THING_TYPE_UIDS.contains(thingTypeUID)) {

        logger.debug("Creating SleepIQ dual bed thing handler");
        return new SleepIQDualBedHandler(thing);
    }

    return null;
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:20,代码来源:SleepIQHandlerFactory.java

示例7: createHandler

import org.eclipse.smarthome.core.thing.Thing; //导入方法依赖的package包/类
@Override
protected ThingHandler createHandler(final Thing thing) {

    ThingTypeUID thingTypeUID = thing.getThingTypeUID();

    if (thingTypeUID.equals(SilvercrestWifiSocketBindingConstants.THING_TYPE_WIFI_SOCKET)) {
        SilvercrestWifiSocketHandler handler;
        logger.debug("Creating a new SilvercrestWifiSocketHandler...");
        try {
            handler = new SilvercrestWifiSocketHandler(thing);
            logger.debug("SilvercrestWifiSocketMediator will register the handler.");
            if (this.mediator != null) {
                this.mediator.registerThingAndWifiSocketHandler(thing, handler);
            } else {
                logger.error(
                        "The mediator is missing on Handler factory. Without one mediator the handler cannot work!");
                return null;
            }
            return handler;
        } catch (MacAddressNotValidException e) {
            logger.debug("The mac address passed to WifiSocketHandler by configurations is not valid.");
        }

    }
    return null;
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:27,代码来源:SilvercrestWifiSocketHandlerFactory.java

示例8: createHandler

import org.eclipse.smarthome.core.thing.Thing; //导入方法依赖的package包/类
@Override
protected ThingHandler createHandler(Thing thing) {
    ThingTypeUID thingTypeUID = thing.getThingTypeUID();

    if (thingTypeUID.equals(THING_TYPE_STICK)) {
        PlugwiseStickHandler handler = new PlugwiseStickHandler((Bridge) thing);
        registerDiscoveryService(handler);
        return handler;
    } else if (thingTypeUID.equals(THING_TYPE_CIRCLE) || thingTypeUID.equals(THING_TYPE_CIRCLE_PLUS)
            || thingTypeUID.equals(THING_TYPE_STEALTH)) {
        return new PlugwiseRelayDeviceHandler(thing);
    } else if (thingTypeUID.equals(THING_TYPE_SCAN)) {
        return new PlugwiseScanHandler(thing);
    } else if (thingTypeUID.equals(THING_TYPE_SENSE)) {
        return new PlugwiseSenseHandler(thing);
    } else if (thingTypeUID.equals(THING_TYPE_SWITCH)) {
        return new PlugwiseSwitchHandler(thing);
    }

    return null;
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:22,代码来源:PlugwiseHandlerFactory.java

示例9: createHandler

import org.eclipse.smarthome.core.thing.Thing; //导入方法依赖的package包/类
@Override
protected ThingHandler createHandler(Thing thing) {
    ThingTypeUID thingTypeUID = thing.getThingTypeUID();

    if (thingTypeUID.equals(THING_TYPE_SAMPLE)) {
        return new EventBusHandler(thing);
    }

    return null;
}
 
开发者ID:IncQueryLabs,项目名称:smarthome-cep-demonstrator,代码行数:11,代码来源:EventBusHandlerFactory.java

示例10: createHandler

import org.eclipse.smarthome.core.thing.Thing; //导入方法依赖的package包/类
@Override
protected ThingHandler createHandler(Thing thing) {
    ThingTypeUID thingTypeUID = thing.getThingTypeUID();

    if (thingTypeUID.equals(THING_TYPE_SIMPLE_MOTION_SENSOR)) {
        return new SimpleMotionSensorHandler(thing);
    }

    return null;
}
 
开发者ID:IncQueryLabs,项目名称:smarthome-cep-demonstrator,代码行数:11,代码来源:SimpleMotionSensorHandlerFactory.java

示例11: createHandler

import org.eclipse.smarthome.core.thing.Thing; //导入方法依赖的package包/类
@Override
protected ThingHandler createHandler(final Thing thing) {

    if ((zmoteService == null) || (zmoteDiscoveryService == null)) {
        throw new IllegalStateException("Cannot create ZMote thing as the required services are not available!");
    }

    final ThingTypeUID thingTypeUID = thing.getThingTypeUID();

    if (thingTypeUID.equals(THING_TYPE_ZMT2)) {
        return new ZMoteHandler(thing, zmoteService, zmoteDiscoveryService);
    }

    return null;
}
 
开发者ID:alexmaret,项目名称:openhab-binding-zmote,代码行数:16,代码来源:ZMoteHandlerFactory.java

示例12: createHandler

import org.eclipse.smarthome.core.thing.Thing; //导入方法依赖的package包/类
@Override
protected @Nullable ThingHandler createHandler(Thing thing) {
    ThingTypeUID thingTypeUID = thing.getThingTypeUID();

    if (thingTypeUID.equals(THING_TYPE_ROOM)) {
        return new DraytonWiserHandler(thing);
    }

    return null;
}
 
开发者ID:RobPope,项目名称:DraytonWiser,代码行数:11,代码来源:DraytonWiserHandlerFactory.java

示例13: createHandler

import org.eclipse.smarthome.core.thing.Thing; //导入方法依赖的package包/类
@Override
protected ThingHandler createHandler(Thing thing) {
    ThingTypeUID uid = thing.getThingTypeUID();
    if (uid.equals(LoxoneBindingConstants.THING_TYPE_MINISERVER)) {
        if (channelTypeProvider == null) {
            // It indicates some problem with channel type provide service, but it is not a show stopper for the
            // binding, as majority of channels are defined statically
            logger.warn("Channel type provider is null when creating Miniserver thing handler.");
        }
        LoxoneMiniserverHandler handler = new LoxoneMiniserverHandler(thing, channelTypeProvider);
        return handler;
    }
    return null;
}
 
开发者ID:ppieczul,项目名称:org.openhab.binding.loxone,代码行数:15,代码来源:LoxoneHandlerFactory.java

示例14: createHandler

import org.eclipse.smarthome.core.thing.Thing; //导入方法依赖的package包/类
@Override
protected ThingHandler createHandler(Thing thing) {

    ThingTypeUID thingTypeUID = thing.getThingTypeUID();

    if (thingTypeUID.equals(THING_TYPE_HS100)) {
        return new HS110Handler(thing);
    }
    if (thingTypeUID.equals(THING_TYPE_HS110)) {
        return new HS110Handler(thing);
    }

    return null;
}
 
开发者ID:computerlyrik,项目名称:openhab2-addon-hs110,代码行数:15,代码来源:HS110HandlerFactory.java

示例15: createHandler

import org.eclipse.smarthome.core.thing.Thing; //导入方法依赖的package包/类
@Override
protected ThingHandler createHandler(Thing thing) {
    ThingTypeUID thingTypeUID = thing.getThingTypeUID();

    logger.debug("Creating coordinator handler for {}", thing);

    ZigBeeCoordinatorHandler coordinator = null;

    // Handle coordinators here
    if (thingTypeUID.equals(ZigBeeBindingConstants.COORDINATOR_TYPE_CC2531)) {
        coordinator = new ZigBeeCoordinatorCC2531Handler((Bridge) thing, translationProvider);
    }
    // if (thingTypeUID.equals(ZigBeeBindingConstants.COORDINATOR_TYPE_CONBEE)) {
    // coordinator = new ZigBeeCoordinatorConBeeHandler((Bridge) thing, translationProvider);
    // }
    if (thingTypeUID.equals(ZigBeeBindingConstants.COORDINATOR_TYPE_EMBER)) {
        coordinator = new ZigBeeCoordinatorEmberHandler((Bridge) thing, translationProvider);
    }
    if (thingTypeUID.equals(ZigBeeBindingConstants.COORDINATOR_TYPE_TELEGESIS)) {
        coordinator = new ZigBeeCoordinatorTelegesisHandler((Bridge) thing, translationProvider);
    }

    if (coordinator != null) {
        ZigBeeDiscoveryService discoveryService = new ZigBeeDiscoveryService(coordinator);
        discoveryService.activate();

        discoveryServiceRegs.put(coordinator.getThing().getUID(), bundleContext.registerService(
                DiscoveryService.class.getName(), discoveryService, new Hashtable<String, Object>()));

        return coordinator;
    }

    // Everything else gets handled in a single handler
    ZigBeeThingHandler handler = new ZigBeeThingHandler(thing, translationProvider);

    bundleContext.registerService(ConfigDescriptionProvider.class.getName(), handler,
            new Hashtable<String, Object>());

    return handler;
}
 
开发者ID:openhab,项目名称:org.openhab.binding.zigbee,代码行数:41,代码来源:ZigBeeHandlerFactory.java


注:本文中的org.eclipse.smarthome.core.thing.Thing.getThingTypeUID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。