本文整理汇总了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));
}
}
}
示例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);
}
}
}
示例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));
}
}
示例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);
}
}
}
示例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));
}
}