• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Bridge类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Bridge类属于org.eclipse.smarthome.core.thing包,在下文中一共展示了Bridge类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createHandler

import org.eclipse.smarthome.core.thing.Bridge; //导入依赖的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: getBridgeHandler

import org.eclipse.smarthome.core.thing.Bridge; //导入依赖的package包/类
private synchronized WMBusBridgeHandler getBridgeHandler() {
    if (this.bridgeHandler == null) {
        Bridge bridge = getBridge();
        if (bridge == null) {
            return null;
        }
        ThingHandler handler = bridge.getHandler();
        if (handler instanceof WMBusBridgeHandler) {
            this.bridgeHandler = (WMBusBridgeHandler) handler;
            this.bridgeHandler.registerWMBusMessageListener(this);
        } else {
            return null;
        }
    }
    return this.bridgeHandler;
}
 
开发者ID:pokerazor,项目名称:openhab-binding-wmbus,代码行数:17,代码来源:WMBusTechemHKVHandler.java


示例3: createHandler

import org.eclipse.smarthome.core.thing.Bridge; //导入依赖的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


示例4: createHandler

import org.eclipse.smarthome.core.thing.Bridge; //导入依赖的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


示例5: getMaxCubeBridgeHandler

import org.eclipse.smarthome.core.thing.Bridge; //导入依赖的package包/类
private synchronized MaxCubeBridgeHandler getMaxCubeBridgeHandler() {

		if (this.bridgeHandler == null) {
			Bridge bridge = getBridge();
			if (bridge == null) {
				logger.debug("Required bridge not defined for device {}.", maxDeviceSerial);
				return null;
			}
			ThingHandler handler = bridge.getHandler();
			if (handler instanceof MaxCubeBridgeHandler) {
				this.bridgeHandler = (MaxCubeBridgeHandler) handler;
				this.bridgeHandler.registerDeviceStatusListener(this);
			} else {
				logger.debug("No available bridge handler found for {} bridge {} .", maxDeviceSerial,
						bridge.getUID());
				return null;
			}
		}
		return this.bridgeHandler;
	}
 
开发者ID:Neulinet,项目名称:Zoo,代码行数:21,代码来源:MaxDevicesHandler.java


示例6: getBridgeHandler

import org.eclipse.smarthome.core.thing.Bridge; //导入依赖的package包/类
private synchronized Ip2WireBridgeHandler getBridgeHandler() {

		if (this.bridgeHandler == null) {
			Bridge bridge = getBridge();
			if (bridge == null) {
				logger.debug("Required bridge not defined for device {}.", deviceWhereAddress);
				return null;
			}
			ThingHandler handler = bridge.getHandler();
			if (handler instanceof Ip2WireBridgeHandler) {
				this.bridgeHandler = (Ip2WireBridgeHandler) handler;
				this.bridgeHandler.registerDeviceStatusListener(this);
			} else {
				logger.debug("No available bridge handler found for {} bridge {} .", deviceWhereAddress,
						bridge.getUID());
				return null;
			}
		}
		return this.bridgeHandler;
	}
 
开发者ID:Neulinet,项目名称:Zoo,代码行数:21,代码来源:OpenWebNetVdesHandler.java


示例7: createHandler

import org.eclipse.smarthome.core.thing.Bridge; //导入依赖的package包/类
@Override
protected ThingHandler createHandler(Thing thing) {
    ElementsDiscoveryService discoveryService = null;
    if (ElementsBindingConstants.THING_TYPE_BASE.equals(thing.getThingTypeUID())) {
        logger.debug("discovery service register");

        ElementsBridgeHandler bridgetHandler = new ElementsBridgeHandler(thing, discoveryService);

        discoveryService = new ElementsDiscoveryService((Bridge) thing, 15);
        this.discoveryServiceReg = bundleContext.registerService(DiscoveryService.class.getName(), discoveryService,
                new Hashtable<String, Object>());
        logger.debug("done ElementsDiscoveryService");
        return bridgetHandler;
    }
    return new ElementsThingHandler(thing);
}
 
开发者ID:hkuhn42,项目名称:openhab2.elements,代码行数:17,代码来源:ElementsHandlerFactory.java


示例8: createHandler

import org.eclipse.smarthome.core.thing.Bridge; //导入依赖的package包/类
@Override
protected ThingHandler createHandler(Thing thing) {
    logger.debug("MeteoStick thing factory: createHandler {} of type {}", thing.getThingTypeUID(), thing.getUID());

    ThingTypeUID thingTypeUID = thing.getThingTypeUID();

    if (MeteostickBridgeHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) {
        return new MeteostickBridgeHandler((Bridge) thing);
    }

    if (MeteostickSensorHandler.SUPPORTED_THING_TYPES.contains(thingTypeUID)) {
        return new MeteostickSensorHandler(thing);
    }

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


示例9: createHandler

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

    if (thingTypeUID.equals(IP_BRIDGE_THING_TYPE)) {
        return new PentairIPBridgeHandler((Bridge) thing);
    } else if (thingTypeUID.equals(SERIAL_BRIDGE_THING_TYPE)) {
        return new PentairSerialBridgeHandler((Bridge) thing);
    } else if (thingTypeUID.equals(EASYTOUCH_THING_TYPE)) {
        return new PentairEasyTouchHandler(thing);
    } else if (thingTypeUID.equals(INTELLIFLO_THING_TYPE)) {
        return new PentairIntelliFloHandler(thing);
    } else if (thingTypeUID.equals(INTELLICHLOR_THING_TYPE)) {
        return new PentairIntelliChlorHandler(thing);
    }

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


示例10: updateThingStatus

import org.eclipse.smarthome.core.thing.Bridge; //导入依赖的package包/类
private void updateThingStatus() {
    if (getItemId() != null) {
        // note: this call implicitly registers our handler as a listener on the bridge, if it's not already
        if (getXiaomiBridgeHandler() != null) {
            Bridge bridge = getBridge();
            ThingStatus bridgeStatus = (bridge == null) ? null : bridge.getStatus();
            if (bridgeStatus == ThingStatus.ONLINE) {
                ThingStatus itemStatus = getThing().getStatus();
                boolean hasItemActivity = getXiaomiBridgeHandler().hasItemActivity(getItemId(),
                        ONLINE_TIMEOUT_MILLIS);
                ThingStatus newStatus = hasItemActivity ? ThingStatus.ONLINE : ThingStatus.OFFLINE;

                if (!newStatus.equals(itemStatus)) {
                    updateStatus(newStatus);
                }
            } else {
                updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE);
            }
        } else {
            updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR);
        }
    } else {
        updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR);
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:26,代码来源:XiaomiDeviceBaseHandler.java


示例11: getXiaomiBridgeHandler

import org.eclipse.smarthome.core.thing.Bridge; //导入依赖的package包/类
synchronized XiaomiBridgeHandler getXiaomiBridgeHandler() {
    if (this.bridgeHandler == null) {
        Bridge bridge = getBridge();
        if (bridge == null) {
            return null;
        }
        ThingHandler handler = bridge.getHandler();
        if (handler instanceof XiaomiBridgeHandler) {
            this.bridgeHandler = (XiaomiBridgeHandler) handler;
            this.bridgeHandler.registerItemListener(this);
        } else {
            return null;
        }
    }
    return this.bridgeHandler;
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:17,代码来源:XiaomiDeviceBaseHandler.java


示例12: createHandler

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

    ThingTypeUID thingTypeUID = thing.getThingTypeUID();

    if (thingTypeUID.equals(RioConstants.BRIDGE_TYPE_RIO)) {
        final RioSystemHandler sysHandler = new RioSystemHandler((Bridge) thing);
        registerThingDiscovery(sysHandler);
        return sysHandler;
    } else if (thingTypeUID.equals(RioConstants.BRIDGE_TYPE_CONTROLLER)) {
        return new RioControllerHandler((Bridge) thing);
    } else if (thingTypeUID.equals(RioConstants.THING_TYPE_SOURCE)) {
        return new RioSourceHandler(thing);
    } else if (thingTypeUID.equals(RioConstants.THING_TYPE_ZONE)) {
        return new RioZoneHandler(thing);
    }

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


示例13: getMieleBridgeHandler

import org.eclipse.smarthome.core.thing.Bridge; //导入依赖的package包/类
private synchronized MieleBridgeHandler getMieleBridgeHandler() {
    if (this.bridgeHandler == null) {
        Bridge bridge = getBridge();
        if (bridge == null) {
            return null;
        }
        ThingHandler handler = bridge.getHandler();
        if (handler instanceof MieleBridgeHandler) {
            this.bridgeHandler = (MieleBridgeHandler) handler;
            this.bridgeHandler.registerApplianceStatusListener(this);
        } else {
            return null;
        }
    }
    return this.bridgeHandler;
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:17,代码来源:MieleApplianceHandler.java


示例14: createHandler

import org.eclipse.smarthome.core.thing.Bridge; //导入依赖的package包/类
@Override
protected ThingHandler createHandler(Thing thing) {
    logger.trace("Install Handler for Thing {}", thing.toString());

    ThingTypeUID thingTypeUID = thing.getThingTypeUID();

    if (thingTypeUID.equals(VitotronicBindingConstants.THING_TYPE_UID_BRIDGE)) {
        VitotronicBridgeHandler handler = new VitotronicBridgeHandler((Bridge) thing);
        registerThingDiscovery(handler);
        return handler;
    }

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

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


示例15: createHandler

import org.eclipse.smarthome.core.thing.Bridge; //导入依赖的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


示例16: createHandler

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

    if (thingTypeUid.equals(JEELINK_USB_STICK_THING_TYPE) || thingTypeUid.equals(JEELINK_TCP_STICK_THING_TYPE)) {
        logger.debug("creating JeeLinkHandler for thing {}...", thing.getUID().getId());

        handler = new JeeLinkHandler((Bridge) thing);
        registerSensorDiscoveryService((JeeLinkHandler) handler);
    } else {
        handler = SensorDefinition.createHandler(thingTypeUid, thing);

        if (handler == null) {
            logger.debug("skipping creation of unknown handler for thing {} with type {}...",
                    thing.getUID().getId(), thing.getThingTypeUID().getId());
        }
    }

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


示例17: initialize

import org.eclipse.smarthome.core.thing.Bridge; //导入依赖的package包/类
@Override
public void initialize() {
    super.initialize();
    Bridge bridge = getBridge();
    if (bridge != null) {
        logger.debug("Initializing {} with id '{}'", getClass(), getId());
        if (bridge.getStatus() == ThingStatus.ONLINE) {
            defineRefreshInterval();
            updateStatus(ThingStatus.ONLINE);
            scheduleRefreshJob();
        } else {
            logger.debug("setting device '{}' offline (bridge or thing offline)", getId());
            updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.BRIDGE_OFFLINE);
        }
    } else {
        logger.debug("setting device '{}' offline (bridge == null)", getId());
        updateStatus(ThingStatus.OFFLINE);
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:20,代码来源:NetatmoDeviceHandler.java


示例18: getPulseaudioBridgeHandler

import org.eclipse.smarthome.core.thing.Bridge; //导入依赖的package包/类
private synchronized PulseaudioBridgeHandler getPulseaudioBridgeHandler() {

        if (this.bridgeHandler == null) {
            Bridge bridge = getBridge();
            if (bridge == null) {
                logger.debug("Required bridge not defined for device {}.", name);
                return null;
            }
            ThingHandler handler = bridge.getHandler();
            if (handler instanceof PulseaudioBridgeHandler) {
                this.bridgeHandler = (PulseaudioBridgeHandler) handler;
                this.bridgeHandler.registerDeviceStatusListener(this);
            } else {
                logger.debug("No available bridge handler found for device {} bridge {} .", name, bridge.getUID());
                return null;
            }
        }
        return this.bridgeHandler;
    }
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:20,代码来源:PulseaudioHandler.java


示例19: createHandler

import org.eclipse.smarthome.core.thing.Bridge; //导入依赖的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


示例20: initialize

import org.eclipse.smarthome.core.thing.Bridge; //导入依赖的package包/类
@Override
public void initialize() {
    Configuration config = thing.getConfiguration();
    if (config == null) {
        updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR);
        return;
    }

    houseUnitCode = (String) config.get(HOUSE_UNIT_CODE);
    Bridge bridge = getBridge();
    if (ThingStatus.ONLINE.equals(bridge.getStatus())) {
        updateStatus(ThingStatus.ONLINE);
    } else {
        updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE);
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:17,代码来源:Cm11aAbstractHandler.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SVNWCClient类代码示例发布时间:2022-05-22
下一篇:
Java InfoBar类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap