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


Java BindingProvider.providesBindingFor方法代码示例

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


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

示例1: bindingChanged

import org.openhab.core.binding.BindingProvider; //导入方法依赖的package包/类
public void bindingChanged(BindingProvider provider, String itemName)
{
  boolean added = provider.providesBindingFor(itemName);
  logger.info("Binding {} {}", itemName, (added ? "added" : "removed"));

  if (added && provider instanceof HdlBindingProvider) {
    HdlBindingConfig config = ((HdlBindingProvider)provider).getConfigFor(itemName);
    if (config == null || server == null) {
      return;
    }

    if (server.getDevice(config.address) == null) {
      HdlDimmer d = new HdlDimmer(config.address, server);
      d.addListener(this);
      server.addDevice(d);
      logger.info("Listening for events from {}", Integer.toHexString(config.address));
    }
  }
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:20,代码来源:HdlBinding.java

示例2: allBindingsChanged

import org.openhab.core.binding.BindingProvider; //导入方法依赖的package包/类
@Override
public void allBindingsChanged(BindingProvider provider) {
	
	// clear all previous listeners..
	commandReceiver.unregisterAll();
	
	NikobusBindingProvider bindingProvider = (NikobusBindingProvider) provider;
	for (String itemName : provider.getItemNames()) {
		if (provider.providesBindingFor(itemName)) {
			register(bindingProvider.getItemConfig(itemName));
			log.trace("Registering command listener for item {} ", itemName);
		}
	}

}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:16,代码来源:NikobusBinding.java

示例3: bindingChanged

import org.openhab.core.binding.BindingProvider; //导入方法依赖的package包/类
@Override
public void bindingChanged(BindingProvider provider, String itemName) {
	NikobusBindingProvider bindingProvider = (NikobusBindingProvider) provider;
	if (!provider.providesBindingFor(itemName)) {
		log.trace("Removing command listener for item {}", itemName);
		commandReceiver.unregisterItem(itemName);
	} else {
		log.trace("Registering command listener for item {} ", itemName);
		register(bindingProvider.getItemConfig(itemName));
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:12,代码来源:NikobusBinding.java

示例4: allBindingsChanged

import org.openhab.core.binding.BindingProvider; //导入方法依赖的package包/类
@Override
public void allBindingsChanged(BindingProvider provider) {

    // clear all previous listeners..
    commandReceiver.unregisterAll();

    NikobusBindingProvider bindingProvider = (NikobusBindingProvider) provider;
    for (String itemName : provider.getItemNames()) {
        if (provider.providesBindingFor(itemName)) {
            register(bindingProvider.getItemConfig(itemName));
            log.trace("Registering command listener for item {} ", itemName);
        }
    }

}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:16,代码来源:NikobusBinding.java

示例5: bindingChanged

import org.openhab.core.binding.BindingProvider; //导入方法依赖的package包/类
@Override
public void bindingChanged(BindingProvider provider, String itemName) {
    NikobusBindingProvider bindingProvider = (NikobusBindingProvider) provider;
    if (!provider.providesBindingFor(itemName)) {
        log.trace("Removing command listener for item {}", itemName);
        commandReceiver.unregisterItem(itemName);
    } else {
        log.trace("Registering command listener for item {} ", itemName);
        register(bindingProvider.getItemConfig(itemName));
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:12,代码来源:NikobusBinding.java


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