本文整理汇总了Java中org.openhab.core.binding.BindingConfig类的典型用法代码示例。如果您正苦于以下问题:Java BindingConfig类的具体用法?Java BindingConfig怎么用?Java BindingConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BindingConfig类属于org.openhab.core.binding包,在下文中一共展示了BindingConfig类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getTellstickBindingConfig
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
@Override
public TellstickBindingConfig getTellstickBindingConfig(int id, TellstickValueSelector valueSel, String protocol) {
TellstickBindingConfig name = null;
for (Entry<String, BindingConfig> entry : bindingConfigs.entrySet()) {
TellstickBindingConfig bv = (TellstickBindingConfig) entry.getValue();
if (bv.getId() == id) {
if (valueSel == null || valueSel.equals(bv.getValueSelector())) {
if (protocol == null || bv.getProtocol() == null || protocol.equals(bv.getProtocol())) {
name = bv;
break;
}
}
}
}
return name;
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:19,代码来源:TellstickGenericBindingProvider.java
示例2: getItemNamesForProperty
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public List<String> getItemNamesForProperty(String property) {
ArrayList<String> result = new ArrayList<String>();
// TODO: Make a reverse map somewhere, and keep it around as this is
// going to get a lot of calls, and a lot of garbage along the way!!
for (Entry<String, BindingConfig> bindingConfigEntry : bindingConfigs.entrySet()) {
if (bindingConfigEntry.getValue() instanceof MiosBindingConfig) {
String p = ((MiosBindingConfig) bindingConfigEntry.getValue()).toProperty();
if (p.equals(property)) {
logger.trace("getItemNamesForProperty: MATCH property '{}' against BindingConfig.toProperty '{}'",
property, p);
String itemName = bindingConfigEntry.getKey();
result.add(itemName);
}
}
}
return result;
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:26,代码来源:MiosBindingProviderImpl.java
示例3: getConfigsForSerialNumber
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
@Override
public List<MaxCulBindingConfig> getConfigsForSerialNumber(String serial) {
List<MaxCulBindingConfig> configs = new ArrayList<MaxCulBindingConfig>();
for (BindingConfig c : super.bindingConfigs.values()) {
MaxCulBindingConfig config = (MaxCulBindingConfig) c;
if (config.getSerialNumber() != null) /*
* could be PairMode/ListenMode
* device which has no serial
*/
{
if (config.getSerialNumber().compareToIgnoreCase(serial) == 0)
configs.add(config);
}
}
if (configs.isEmpty())
return null;
else
return configs;
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:20,代码来源:MaxCulGenericBindingProvider.java
示例4: getConfigsForRadioAddr
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
@Override
public List<MaxCulBindingConfig> getConfigsForRadioAddr(String addr) {
List<MaxCulBindingConfig> configs = new ArrayList<MaxCulBindingConfig>();
for (BindingConfig c : super.bindingConfigs.values()) {
MaxCulBindingConfig config = (MaxCulBindingConfig) c;
if (config.getSerialNumber() != null) /*
* could be PairMode/ListenMode
* device which has no serial
*/
{
if (config.getDevAddr().equalsIgnoreCase(addr))
configs.add(config);
}
}
return configs;
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:17,代码来源:MaxCulGenericBindingProvider.java
示例5: processBindingConfiguration
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException {
super.processBindingConfiguration(context, item, bindingConfig);
try {
if (bindingConfig != null) {
String[] configParts = bindingConfig.split(";");
if (configParts.length < 2 || configParts.length >2) {
throw new BindingConfigParseException ("energenie binding configuration must have two parts");
}
BindingConfig energenieBindingConfig = (BindingConfig) new EnergenieBindingConfig(configParts[0], configParts[1]);
addBindingConfig(item,energenieBindingConfig);
} else {
logger.warn("bindingConfig is NULL (item=" + item
+ ") -> processing bindingConfig aborted!");
}
} catch (ArrayIndexOutOfBoundsException e) {
logger.warn("bindingConfig is invalid (item=" + item
+ ") -> processing bindingConfig aborted!");
}
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:26,代码来源:EnergenieGenericBindingProvider.java
示例6: isCommandGA
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
@Override
public boolean isCommandGA(final GroupAddress groupAddress) {
synchronized(bindingConfigs) {
for (BindingConfig config : bindingConfigs.values()) {
KNXBindingConfig knxConfig = (KNXBindingConfig) config;
for (KNXBindingConfigItem configItem : knxConfig) {
if (configItem.allDataPoints.contains(groupAddress)) {
if(configItem.mainDataPoint instanceof CommandDP) {
if(configItem.mainDataPoint.getMainAddress().equals(groupAddress)) {
// the first GA in a CommandDP is always a command GA
return true;
} else {
return false;
}
} else {
// it is a StateDP, so the GA cannot be a command GA
return false;
}
}
}
}
}
return false;
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:25,代码来源:KNXGenericBindingProvider.java
示例7: autoUpdate
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
@Override
public Boolean autoUpdate(String itemName) {
BindingConfig config = bindingConfigs.get(itemName);
if(config instanceof KNXBindingConfig) {
KNXBindingConfig knxConfig = (KNXBindingConfig) config;
Iterator<KNXBindingConfigItem> it = knxConfig.iterator();
while(it.hasNext()) {
KNXBindingConfigItem item = it.next();
if(item.allDataPoints.getDatapoints().size()>1) {
// If the datapoint is a CommandDP, the first GA is the command GA, all other are listening GAs.
// If the datapoint is a StateDP, all GAs are listening GAs.
// If we have a single DPT configured with a command GA and at least one listening GA,
// we deactivate the auto-update as we assume that status updates after a command
// will come from KNX.
return false;
}
}
}
return null;
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:21,代码来源:KNXGenericBindingProvider.java
示例8: getTellstickBindingConfig
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
@Override
public TellstickBindingConfig getTellstickBindingConfig(int id, TellstickValueSelector valueSel, String protocol) {
TellstickBindingConfig name = null;
for (Entry<String, BindingConfig> entry : bindingConfigs.entrySet()) {
TellstickBindingConfig bv = (TellstickBindingConfig) entry.getValue();
if (bv.getId() == id) {
if (valueSel == null || valueSel.equals(bv.getValueSelector())) {
if (protocol == null || bv.getProtocol() == null || protocol.equals(bv.getProtocol())) {
name = bv;
break;
}
}
}
}
return name;
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:19,代码来源:TellstickGenericBindingProvider.java
示例9: getBindingItemName
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
@Override
public String getBindingItemName(String vdrId, VDRCommandType vdrCommand) {
String itemName = null;
logger.debug("Searching for a binding config that matches the id '{}' and command '{}'", vdrId, vdrCommand);
for (BindingConfig config : this.bindingConfigs.values()) {
VDRBindingConfig vdrConfig = (VDRBindingConfig) config;
if (vdrConfig.vDRId.equals(vdrId) && vdrConfig.command.equals(vdrCommand.getVDRCommand())) {
itemName = vdrConfig.item.getName();
logger.debug("Match found: '{}'", itemName);
break;
} else {
logger.debug("Not a match: '{}':'{}'", vdrConfig.vDRId, vdrConfig.command);
}
}
return itemName;
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:18,代码来源:VDRGenericBindingProvider.java
示例10: getItemNamesForProperty
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public List<String> getItemNamesForProperty(String property) {
ArrayList<String> result = new ArrayList<String>();
// TODO: Make a reverse map somewhere, and keep it around as this is
// going to get a lot of calls, and a lot of garbage along the way!!
for (Entry<String, BindingConfig> bindingConfigEntry : bindingConfigs.entrySet()) {
if (bindingConfigEntry.getValue() instanceof MiosBindingConfig) {
String p = ((MiosBindingConfig) bindingConfigEntry.getValue()).toProperty();
if (p.equals(property)) {
logger.trace("getItemNamesForProperty: MATCH property '{}' against BindingConfig.toProperty '{}'",
property, p);
String itemName = bindingConfigEntry.getKey();
result.add(itemName);
}
}
}
return result;
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:26,代码来源:MiosBindingProviderImpl.java
示例11: getConfigsForSerialNumber
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
@Override
public List<MaxCulBindingConfig> getConfigsForSerialNumber(String serial) {
List<MaxCulBindingConfig> configs = new ArrayList<MaxCulBindingConfig>();
for (BindingConfig c : super.bindingConfigs.values()) {
MaxCulBindingConfig config = (MaxCulBindingConfig) c;
if (config.getSerialNumber() != null) /*
* could be PairMode/ListenMode
* device which has no serial
*/
{
if (config.getSerialNumber().compareToIgnoreCase(serial) == 0) {
configs.add(config);
}
}
}
if (configs.isEmpty()) {
return null;
} else {
return configs;
}
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:22,代码来源:MaxCulGenericBindingProvider.java
示例12: getConfigsForRadioAddr
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
@Override
public List<MaxCulBindingConfig> getConfigsForRadioAddr(String addr) {
List<MaxCulBindingConfig> configs = new ArrayList<MaxCulBindingConfig>();
for (BindingConfig c : super.bindingConfigs.values()) {
MaxCulBindingConfig config = (MaxCulBindingConfig) c;
if (config.getSerialNumber() != null) /*
* could be PairMode/ListenMode
* device which has no serial
*/
{
if (config.getDevAddr().equalsIgnoreCase(addr)) {
configs.add(config);
}
}
}
return configs;
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:18,代码来源:MaxCulGenericBindingProvider.java
示例13: getMatchBindingConfigs
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
public Map<String, BindingConfig> getMatchBindingConfigs(
Cardio2eTransaction transaction) { // Returns a Map that
// contains only the
// BindingConfigs with
// Cardio2eTransaction like
// "transaction" and their
// IntemNames
Map<String, BindingConfig> matchBindingConfigs = new HashMap<String, BindingConfig>();
if (!(bindingConfigs.isEmpty())) {
for (String itemName : bindingConfigs.keySet()) {
Cardio2eBindingConfig storedBindingConfig = getConfig(itemName);
Cardio2eBindingConfig matchBindingConfig = new Cardio2eBindingConfig();
for (Cardio2eBindingConfigItem configItem : storedBindingConfig) {
if (configItem.transaction.isLike(transaction)) {
matchBindingConfig.add(configItem);
}
}
if (!matchBindingConfig.isEmpty()) {
matchBindingConfigs.put(itemName, matchBindingConfig);
}
}
}
return matchBindingConfigs;
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:25,代码来源:Cardio2eGenericBindingProvider.java
示例14: isCommandGA
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
@Override
public boolean isCommandGA(final GroupAddress groupAddress) {
synchronized (bindingConfigs) {
for (BindingConfig config : bindingConfigs.values()) {
KNXBindingConfig knxConfig = (KNXBindingConfig) config;
for (KNXBindingConfigItem configItem : knxConfig) {
if (configItem.allDataPoints.contains(groupAddress)) {
if (configItem.mainDataPoint instanceof CommandDP) {
if (configItem.mainDataPoint.getMainAddress().equals(groupAddress)) {
// the first GA in a CommandDP is always a command GA
return true;
} else {
return false;
}
} else {
// it is a StateDP, so the GA cannot be a command GA
return false;
}
}
}
}
}
return false;
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:25,代码来源:KNXGenericBindingProvider.java
示例15: autoUpdate
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
@Override
public Boolean autoUpdate(String itemName) {
BindingConfig config = bindingConfigs.get(itemName);
if (config instanceof KNXBindingConfig) {
KNXBindingConfig knxConfig = (KNXBindingConfig) config;
Iterator<KNXBindingConfigItem> it = knxConfig.iterator();
while (it.hasNext()) {
KNXBindingConfigItem item = it.next();
if (item.allDataPoints.getDatapoints().size() > 1) {
// If the datapoint is a CommandDP, the first GA is the command GA, all other are listening GAs.
// If the datapoint is a StateDP, all GAs are listening GAs.
// If we have a single DPT configured with a command GA and at least one listening GA,
// we deactivate the auto-update as we assume that status updates after a command
// will come from KNX.
return false;
}
}
}
return null;
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:21,代码来源:KNXGenericBindingProvider.java
示例16: isStartStopGA
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
/**
* Determines if the given group address is marked for start-stop dimming.
*
* @param groupAddress the group address to check start-stop dimming for
* @returns true, if the given group address is marked for start-stop dimming, false otherwise.
*/
@Override
public boolean isStartStopGA(GroupAddress groupAddress) {
synchronized (bindingConfigs) {
for (BindingConfig config : bindingConfigs.values()) {
KNXBindingConfig knxConfig = (KNXBindingConfig) config;
for (KNXBindingConfigItem configItem : knxConfig) {
Boolean startStopBehavior = configItem.startStopMap.get(groupAddress);
if (startStopBehavior != null) {
return startStopBehavior;
}
}
}
}
return false;
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:22,代码来源:KNXGenericBindingProvider.java
示例17: getConfigForListenerItem
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
@Override
public List<CalDavNextEventConfig> getConfigForListenerItem(String item) {
List<CalDavNextEventConfig> list = new ArrayList<CalDavNextEventConfig>();
for (BindingConfig bindingConfig : this.bindingConfigs.values()) {
if (!(bindingConfig instanceof CalDavNextEventConfig)) {
continue;
}
CalDavNextEventConfig config = (CalDavNextEventConfig) bindingConfig;
if (config.getItemNameToListenTo().equals(item)) {
list.add(config);
}
}
return list;
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:19,代码来源:CalDavBindingProviderImpl.java
示例18: getItemNames
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
@Override
public List<String> getItemNames(String uniqueId) {
ArrayList<String> list = new ArrayList<String>();
// Search for id
for (Entry<String, BindingConfig> entry : bindingConfigs.entrySet()) {
EBusBindingConfig cfg = (EBusBindingConfig) entry.getValue();
String clazz = (String) cfg.map.get("class");
String id = (String) cfg.map.get("id");
if (clazz != null) {
// logger.warn("Use of property class \"{}\" for id \"{}\" is deprecated!", clazz, id);
}
id = clazz == null ? id : clazz + "." + id;
if (StringUtils.equals(id, uniqueId)) {
list.add(entry.getKey());
}
}
return list;
}
开发者ID:openhab,项目名称:openhab1-addons,代码行数:26,代码来源:EBusGenericBindingProvider.java
示例19: getConfigByTypeAndAddressAndDatapoint
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
@Override
public EMBindingConfig getConfigByTypeAndAddressAndDatapoint(EMType type, String address, Datapoint datapoint) {
for (BindingConfig config : super.bindingConfigs.values()) {
EMBindingConfig emConfig = (EMBindingConfig) config;
if (emConfig.getAddress().equals(address) && emConfig.getType() == type
&& emConfig.getDatapoint() == datapoint) {
return emConfig;
}
}
return null;
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:12,代码来源:EMGenericBindingProvider.java
示例20: getBindingItemName
import org.openhab.core.binding.BindingConfig; //导入依赖的package包/类
public String getBindingItemName(String vdrId, VDRCommandType vdrCommand) {
String itemName = null;
for (BindingConfig config : this.bindingConfigs.values()) {
VDRBindingConfig vdrConfig = (VDRBindingConfig) config;
if (vdrConfig.vDRId.equals(vdrId)
&& vdrConfig.command.equals(vdrCommand.getVDRCommand())) {
itemName = vdrConfig.item.getName();
break;
}
}
return itemName;
}
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:14,代码来源:VDRGenericBindingProvider.java
注:本文中的org.openhab.core.binding.BindingConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论