本文整理汇总了Java中org.openhab.core.binding.BindingProvider类的典型用法代码示例。如果您正苦于以下问题:Java BindingProvider类的具体用法?Java BindingProvider怎么用?Java BindingProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BindingProvider类属于org.openhab.core.binding包,在下文中一共展示了BindingProvider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: bindingChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
/**
* Inherited from AbstractActiveBinding.
* This method is called by the framework whenever there are changes to
* a binding configuration.
* @param provider the binding provider where the binding has changed
* @param itemName the item name for which the binding has changed
*/
@Override
public void bindingChanged(BindingProvider provider, String itemName) {
super.bindingChanged(provider, itemName);
m_hasInitialItemConfig = true; // hack around openHAB bug
InsteonPLMBindingConfig c =
((InsteonPLMBindingProvider)provider).getInsteonPLMBindingConfig(itemName);
logger.debug("item {} binding changed: {}", String.format("%-30s", itemName), c);
if (c == null) {
// Item has been removed. This condition is also found when *any*
// change to the items file is made: the items are first removed (c == null),
// and then added anew.
removeFeatureListener(itemName);
} else {
InsteonDevice dev = getDevice(c.getAddress());
if (dev == null) {
dev = makeNewDevice(c);
}
addFeatureListener(dev, itemName, c);
}
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:28,代码来源:InsteonPLMActiveBinding.java
示例3: bindingChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
/**
* Called, if a single binding has changed. The given item could have been
* added or removed. We refresh the binding in case it's in the done stage.
*
* @param provider the binding provider where the binding has changed
* @param itemName the item name for which the binding has changed
*/
@Override
public void bindingChanged(BindingProvider provider, String itemName) {
logger.trace("bindingChanged {}", itemName);
ZWaveBindingProvider zProvider = (ZWaveBindingProvider)provider;
if (zProvider != null) {
ZWaveBindingConfig bindingConfig = zProvider.getZwaveBindingConfig(itemName);
if (bindingConfig != null && converterHandler != null) {
converterHandler.executeRefresh(zProvider, itemName, true);
}
}
// Bindings have changed - rebuild the polling table
rebuildPollingTable();
super.bindingChanged(provider, itemName);
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:27,代码来源:ZWaveActiveBinding.java
示例4: bindingChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
@Override
public void bindingChanged(BindingProvider provider, String itemName) {
logger.trace("bindingChanged() for item {} msg received.", itemName);
if (mKNXConnectionEstablished) {
if (provider instanceof KNXBindingProvider) {
KNXBindingProvider knxProvider = (KNXBindingProvider) provider;
for (Datapoint datapoint : knxProvider.getReadableDatapoints()) {
if(datapoint.getName().equals(itemName)) {
logger.debug("Initializing read of item {}.", itemName);
if (!mKNXBusReaderScheduler.scheduleRead(datapoint, knxProvider.getAutoRefreshTime(datapoint))) {
logger.warn("Couldn't add to KNX bus reader scheduler (bindingChanged, datapoint='{}')",datapoint);
}
break;
}
}
}
}
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:19,代码来源:KNXBinding.java
示例5: allBindingsChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
@Override
public void allBindingsChanged(BindingProvider provider) {
logger.trace("allBindingsChanged() msg received.");
if (mKNXConnectionEstablished) {
logger.debug("Initializing readable DPs.");
if (provider instanceof KNXBindingProvider) {
KNXBindingProvider knxProvider = (KNXBindingProvider) provider;
mKNXBusReaderScheduler.clear();
for (Datapoint datapoint : knxProvider.getReadableDatapoints()) {
mKNXBusReaderScheduler.readOnce(datapoint);
int autoRefreshTimeInSecs=knxProvider.getAutoRefreshTime(datapoint);
if (autoRefreshTimeInSecs>0) {
if (!mKNXBusReaderScheduler.scheduleRead(datapoint, knxProvider.getAutoRefreshTime(datapoint))) {
logger.warn("Couldn't add to KNX bus reader scheduler (allBindingsChanged, datapoint='{}')",datapoint);
}
}
}
}
}
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:22,代码来源:KNXBinding.java
示例6: bindingChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
@Override
public void bindingChanged(BindingProvider prov, String itemName) {
if (prov.getItemNames().contains(itemName)) {
try {
createInternalItem(itemName, prov);
} catch (Ipx800UnknownDeviceException e) {
logger.error("Item {} will be ignored", itemName);
}
} else {
logger.debug("Removing item {}", itemName);
for (String deviceName : devices.keySet()) {
for (Ipx800Port slot : devices.get(deviceName).getAllPorts()) {
slot.destroyItem(itemName);
}
}
}
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:18,代码来源:Ipx800Binding.java
示例7: bindingChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
/**
* Inherited from AbstractActiveBinding.
* This method is called by the framework whenever there are changes to
* a binding configuration.
*
* @param provider the binding provider where the binding has changed
* @param itemName the item name for which the binding has changed
*/
@Override
public void bindingChanged(BindingProvider provider, String itemName) {
super.bindingChanged(provider, itemName);
m_hasInitialItemConfig = true; // hack around openHAB bug
InsteonPLMBindingConfig c = ((InsteonPLMBindingProvider) provider).getInsteonPLMBindingConfig(itemName);
logger.debug("item {} binding changed: {}", String.format("%-30s", itemName), c);
if (c == null) {
// Item has been removed. This condition is also found when *any*
// change to the items file is made: the items are first removed (c == null),
// and then added anew.
removeFeatureListener(itemName);
} else {
InsteonDevice dev = getDevice(c.getAddress());
if (dev == null) {
dev = makeNewDevice(c);
}
addFeatureListener(dev, itemName, c);
}
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:28,代码来源:InsteonPLMActiveBinding.java
示例8: bindingChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
/**
* Called, if a single binding has changed. The given item could have been
* added or removed. We refresh the binding in case it's in the done stage.
*
* @param provider the binding provider where the binding has changed
* @param itemName the item name for which the binding has changed
*/
@Override
public void bindingChanged(BindingProvider provider, String itemName) {
logger.trace("bindingChanged {}", itemName);
ZWaveBindingProvider zProvider = (ZWaveBindingProvider) provider;
if (zProvider != null) {
ZWaveBindingConfig bindingConfig = zProvider.getZwaveBindingConfig(itemName);
if (bindingConfig != null && converterHandler != null) {
converterHandler.executeRefresh(zProvider, itemName, true);
}
}
// Bindings have changed - rebuild the polling table
rebuildPollingTable();
super.bindingChanged(provider, itemName);
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:27,代码来源:ZWaveActiveBinding.java
示例9: bindingChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
@Override
public void bindingChanged(BindingProvider provider, String itemName) {
if (gpio == null) {
// we are not properly initialized
return;
}
if (provider instanceof MCP23017BindingProvider) {
String allItemNames = Arrays.toString(provider.getItemNames().toArray());
if (provider.getItemNames().contains(itemName)) {
bindGpioPin((MCP23017BindingProvider) provider, itemName);
logger.debug("bindingChanged item bound {} - {}", itemName, allItemNames);
} else {
unBindGpioPin((MCP23017BindingProvider) provider, itemName);
logger.debug("bindingChanged item unbound {} - {}", itemName, allItemNames);
}
}
super.bindingChanged(provider, itemName);
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:19,代码来源:MCP23017Binding.java
示例10: bindingChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
/**
* @{inheritDoc}
*/
@Override
public void bindingChanged(BindingProvider provider, String itemName) {
logger.debug("Denon binding changed for item {}", itemName);
if (provider instanceof DenonBindingProvider) {
DenonBindingConfig config = ((DenonBindingProvider) provider).getConfig(itemName);
if (config != null) {
DenonConnector connector = getConnector(config);
if (connector != null) {
connector.updateStateFromCache(config.getProperty());
} else {
logger.debug("No connector found for item {}", itemName);
}
} else {
logger.debug("No config found for item {}", itemName);
}
}
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:21,代码来源:DenonBinding.java
示例11: bindingChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
@Override
public void bindingChanged(BindingProvider provider, String itemName) {
super.bindingChanged(provider, itemName);
for (Map.Entry<String, Socket> entry : socketCache.entrySet()) {
try {
entry.getValue().close();
} catch (IOException e) {
logger.error("Can't close a socket when binding changed.");
}
}
// Cleanup all sockets
socketCache.clear();
outputStreamCache.clear();
bufferedReaderCache.clear();
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:18,代码来源:SonanceBinding.java
示例12: bindingChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
/**
* Restart scheduler if some binding changes.
*/
@Override
public void bindingChanged(BindingProvider provider, String itemName) {
if (!context.getConfig().finishedParsing()) {
return;
}
if (context.getConfig().isValid()) {
if (provider instanceof WeatherBindingProvider) {
context.getJobScheduler().restart();
}
} else {
logger.debug("Binding for item '{}' changed, but unable to restart weather job "
+ " because weather configuration is not valid. Check openhab.cfg.", itemName);
}
super.bindingChanged(provider, itemName);
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:20,代码来源:WeatherBinding.java
示例13: bindingChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
@Override
public void bindingChanged(BindingProvider provider, String itemName) {
logger.trace("bindingChanged() for item {} msg received.", itemName);
if (mKNXConnectionEstablished) {
if (provider instanceof KNXBindingProvider) {
KNXBindingProvider knxProvider = (KNXBindingProvider) provider;
for (Datapoint datapoint : knxProvider.getReadableDatapoints()) {
if (datapoint.getName().equals(itemName)) {
logger.debug("Initializing read of item {}.", itemName);
if (!mKNXBusReaderScheduler.scheduleRead(datapoint,
knxProvider.getAutoRefreshTime(datapoint))) {
logger.warn("Couldn't add to KNX bus reader scheduler (bindingChanged, datapoint='{}')",
datapoint);
}
break;
}
}
}
}
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:21,代码来源:KNXBinding.java
示例14: allBindingsChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
@Override
public void allBindingsChanged(BindingProvider provider) {
logger.trace("allBindingsChanged() msg received.");
if (mKNXConnectionEstablished) {
logger.debug("Initializing readable DPs.");
if (provider instanceof KNXBindingProvider) {
KNXBindingProvider knxProvider = (KNXBindingProvider) provider;
mKNXBusReaderScheduler.clear();
for (Datapoint datapoint : knxProvider.getReadableDatapoints()) {
mKNXBusReaderScheduler.readOnce(datapoint);
int autoRefreshTimeInSecs = knxProvider.getAutoRefreshTime(datapoint);
if (autoRefreshTimeInSecs > 0) {
if (!mKNXBusReaderScheduler.scheduleRead(datapoint,
knxProvider.getAutoRefreshTime(datapoint))) {
logger.warn("Couldn't add to KNX bus reader scheduler (allBindingsChanged, datapoint='{}')",
datapoint);
}
}
}
}
}
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:24,代码来源:KNXBinding.java
示例15: allBindingsChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
@Override
public void allBindingsChanged(BindingProvider provider) {
if (provider instanceof EnoceanBindingProvider) {
EnoceanBindingProvider enoceanBindingProvider = (EnoceanBindingProvider) provider;
initializeAllItemsInProvider(enoceanBindingProvider);
}
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:8,代码来源:EnoceanBinding.java
示例16: bindingChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
@Override
public void bindingChanged(BindingProvider provider, String itemName) {
if (esp3Host != null) {
if (provider instanceof EnoceanBindingProvider) {
EnoceanBindingProvider enoceanBindingProvider = (EnoceanBindingProvider) provider;
processEEPs(enoceanBindingProvider, itemName);
queryAndSendActualState(enoceanBindingProvider, itemName);
}
}
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:11,代码来源:EnoceanBinding.java
示例17: bindingChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void bindingChanged(BindingProvider provider, String itemName) {
if (provider instanceof NestBindingProvider) {
this.oldDataModel = null;
}
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:10,代码来源:NestBinding.java
示例18: allBindingsChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void allBindingsChanged(BindingProvider provider) {
if (provider instanceof NestBindingProvider) {
this.oldDataModel = null;
}
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:10,代码来源:NestBinding.java
示例19: bindingChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void bindingChanged(BindingProvider provider, String itemName) {
if (provider instanceof PifaceBindingProvider) {
PifaceBindingProvider pifaceProvider = (PifaceBindingProvider) provider;
PifaceBindingConfig bindingConfig = pifaceProvider.getPifaceBindingConfig(itemName);
if (bindingConfig != null && isInitialisableBindingConfig(bindingConfig)) {
bindingConfigsToInitialise.add(bindingConfig);
}
}
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:13,代码来源:PifaceBinding.java
示例20: allBindingsChanged
import org.openhab.core.binding.BindingProvider; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void allBindingsChanged(BindingProvider provider) {
if (provider instanceof PifaceBindingProvider) {
PifaceBindingProvider pifaceProvider = (PifaceBindingProvider) provider;
for (String itemName : pifaceProvider.getItemNames()) {
PifaceBindingConfig bindingConfig = pifaceProvider.getPifaceBindingConfig(itemName);
if (bindingConfig != null && isInitialisableBindingConfig(bindingConfig)) {
bindingConfigsToInitialise.add(bindingConfig);
}
}
}
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:15,代码来源:PifaceBinding.java
注:本文中的org.openhab.core.binding.BindingProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论