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


Java HmRssiInfo类代码示例

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


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

示例1: reloadRssi

import org.openhab.binding.homematic.internal.model.HmRssiInfo; //导入依赖的package包/类
/**
 * Reloads all RSSI values from the Homematic server and publishes only
 * changed values to the openHAB bus.
 */
public void reloadRssi() {
	reloadExecutorPool.execute(new Runnable() {

		@Override
		public void run() {
			try {
				logger.debug("Reloading Homematic server RSSI values");
				Map<String, HmRssiInfo> rssiList = context.getHomematicClient().getRssiInfo();
				for (String address : rssiList.keySet()) {
					HmRssiInfo rssiInfo = rssiList.get(address);
					updateRssiInfo(new DatapointConfig(address, "0", "RSSI_DEVICE"), rssiInfo.getDevice());
					updateRssiInfo(new DatapointConfig(address, "0", "RSSI_PEER"), rssiInfo.getPeer());
				}
				logger.debug("Finished reloading {} Homematic server RSSI values", rssiList.size());
			} catch (HomematicClientException ex) {
				logger.error(ex.getMessage(), ex);
			}
		}
	});
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:25,代码来源:StateHolder.java

示例2: getRssiInfo

import org.openhab.binding.homematic.internal.model.HmRssiInfo; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@SuppressWarnings("unchecked")
@Override
public Map<String, HmRssiInfo> getRssiInfo(HmInterface hmInterface) throws HomematicClientException {
	BinRpcRequest request = new BinRpcRequest("rssiInfo");
	Map<String, HmRssiInfo> rssiList = new HashMap<String, HmRssiInfo>();
	Object[] result = sendMessage(hmInterface, request);
	if (result != null && result.length > 0 && result[0] instanceof Map) {
		Map<String, ?> devices = (Map<String, ?>) result[0];
		for (String sourceDevice : devices.keySet()) {
			Map<String, Object[]> targetDevices = (Map<String, Object[]>) devices.get(sourceDevice);
			for (String targetDevice : targetDevices.keySet()) {
				if (targetDevice.equals(context.getServerId().getAddress())) {
					Integer rssiDevice = (Integer) targetDevices.get(targetDevice)[0];
					Integer rssiPeer = (Integer) targetDevices.get(targetDevice)[1];
					HmRssiInfo rssiInfo = new HmRssiInfo(sourceDevice, rssiDevice, rssiPeer);
					rssiList.put(rssiInfo.getAddress(), rssiInfo);
				}
			}
		}
	}
	return rssiList;
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:26,代码来源:BinRpcClient.java

示例3: parse

import org.openhab.binding.homematic.internal.model.HmRssiInfo; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public List<HmRssiInfo> parse(Object[] result) throws IOException {
    List<HmRssiInfo> rssiList = new ArrayList<HmRssiInfo>();
    if (result != null && result.length > 0 && result[0] instanceof Map) {
        Map<String, ?> devices = (Map<String, ?>) result[0];

        for (String sourceDevice : devices.keySet()) {
            Map<String, Object[]> targetDevices = (Map<String, Object[]>) devices.get(sourceDevice);
            if (targetDevices != null) {
                for (String targetDevice : targetDevices.keySet()) {
                    if (targetDevice.equals(config.getGatewayInfo().getAddress())) {
                        Integer rssiDevice = getAdjustedRssiValue((Integer) targetDevices.get(targetDevice)[0]);
                        Integer rssiPeer = getAdjustedRssiValue((Integer) targetDevices.get(targetDevice)[1]);
                        HmRssiInfo rssiInfo = new HmRssiInfo(sourceDevice, rssiDevice, rssiPeer);
                        rssiList.add(rssiInfo);
                    }
                }
            }
        }
    }
    return rssiList;
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:24,代码来源:RssiInfoParser.java

示例4: reloadRssi

import org.openhab.binding.homematic.internal.model.HmRssiInfo; //导入依赖的package包/类
/**
 * Reloads all RSSI values from the Homematic server and publishes only
 * changed values to the openHAB bus.
 */
public void reloadRssi() {
    reloadExecutorPool.execute(new Runnable() {

        @Override
        public void run() {
            try {
                logger.debug("Reloading Homematic server RSSI values");
                Map<String, HmRssiInfo> rssiList = context.getHomematicClient().getRssiInfo();
                for (String address : rssiList.keySet()) {
                    HmRssiInfo rssiInfo = rssiList.get(address);
                    updateRssiInfo(new DatapointConfig(address, "0", "RSSI_DEVICE"), rssiInfo.getDevice());
                    updateRssiInfo(new DatapointConfig(address, "0", "RSSI_PEER"), rssiInfo.getPeer());
                }
                logger.debug("Finished reloading {} Homematic server RSSI values", rssiList.size());
            } catch (HomematicClientException ex) {
                logger.error(ex.getMessage(), ex);
            }
        }
    });
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:25,代码来源:StateHolder.java

示例5: getRssiInfo

import org.openhab.binding.homematic.internal.model.HmRssiInfo; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@SuppressWarnings("unchecked")
@Override
public Map<String, HmRssiInfo> getRssiInfo(HmInterface hmInterface) throws HomematicClientException {
    BinRpcRequest request = new BinRpcRequest("rssiInfo");
    Map<String, HmRssiInfo> rssiList = new HashMap<String, HmRssiInfo>();
    Object[] result = sendMessage(hmInterface, request);
    if (result != null && result.length > 0 && result[0] instanceof Map) {
        Map<String, ?> devices = (Map<String, ?>) result[0];
        for (String sourceDevice : devices.keySet()) {
            Map<String, Object[]> targetDevices = (Map<String, Object[]>) devices.get(sourceDevice);
            for (String targetDevice : targetDevices.keySet()) {
                if (targetDevice.equals(context.getServerId().getAddress())) {
                    Integer rssiDevice = (Integer) targetDevices.get(targetDevice)[0];
                    Integer rssiPeer = (Integer) targetDevices.get(targetDevice)[1];
                    HmRssiInfo rssiInfo = new HmRssiInfo(sourceDevice, rssiDevice, rssiPeer);
                    rssiList.put(rssiInfo.getAddress(), rssiInfo);
                }
            }
        }
    }
    return rssiList;
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:26,代码来源:BinRpcClient.java

示例6: loadRssiValues

import org.openhab.binding.homematic.internal.model.HmRssiInfo; //导入依赖的package包/类
@Override
public void loadRssiValues() throws IOException {
    for (HmInterface hmInterface : availableInterfaces.keySet()) {
        if (hmInterface == HmInterface.RF || hmInterface == HmInterface.CUXD) {
            List<HmRssiInfo> rssiInfos = getRpcClient(hmInterface).loadRssiInfo(hmInterface);
            for (HmRssiInfo hmRssiInfo : rssiInfos) {
                updateRssiInfo(hmRssiInfo.getAddress(), DATAPOINT_NAME_RSSI_DEVICE, hmRssiInfo.getDevice());
                updateRssiInfo(hmRssiInfo.getAddress(), DATAPOINT_NAME_RSSI_PEER, hmRssiInfo.getPeer());
            }
        }
    }
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:13,代码来源:AbstractHomematicGateway.java

示例7: getRssiInfo

import org.openhab.binding.homematic.internal.model.HmRssiInfo; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Map<String, HmRssiInfo> getRssiInfo() throws HomematicClientException {
	return rpcClient.getRssiInfo(HmInterface.RF);
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:8,代码来源:CcuClient.java

示例8: getRssiInfo

import org.openhab.binding.homematic.internal.model.HmRssiInfo; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Map<String, HmRssiInfo> getRssiInfo() throws HomematicClientException {
	logger.info("Reloading RSSI infos not necessary for Homegear, values are always up to date");
	return new HashMap<String, HmRssiInfo>();
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:9,代码来源:HomegearClient.java

示例9: loadRssiInfo

import org.openhab.binding.homematic.internal.model.HmRssiInfo; //导入依赖的package包/类
/**
 * Returns the rssi values for all devices.
 */
public List<HmRssiInfo> loadRssiInfo(HmInterface hmInterface) throws IOException {
    RpcRequest<T> request = createRpcRequest("rssiInfo");
    return new RssiInfoParser(config).parse(sendMessage(config.getRpcPort(hmInterface), request));
}
 
开发者ID:openhab,项目名称:openhab2-addons,代码行数:8,代码来源:RpcClient.java

示例10: getRssiInfo

import org.openhab.binding.homematic.internal.model.HmRssiInfo; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Map<String, HmRssiInfo> getRssiInfo() throws HomematicClientException {
    return rpcClient.getRssiInfo(HmInterface.RF);
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:8,代码来源:CcuClient.java

示例11: getRssiInfo

import org.openhab.binding.homematic.internal.model.HmRssiInfo; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Map<String, HmRssiInfo> getRssiInfo() throws HomematicClientException {
    logger.info("Reloading RSSI infos not necessary for Homegear, values are always up to date");
    return new HashMap<String, HmRssiInfo>();
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:9,代码来源:HomegearClient.java

示例12: getRssiInfo

import org.openhab.binding.homematic.internal.model.HmRssiInfo; //导入依赖的package包/类
/**
 * Returns all RF devices and their rssi values.
 */
public Map<String, HmRssiInfo> getRssiInfo() throws HomematicClientException;
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:5,代码来源:HomematicClient.java

示例13: getRssiInfo

import org.openhab.binding.homematic.internal.model.HmRssiInfo; //导入依赖的package包/类
/**
 * Returns the rssi info of RF devices.
 */
public Map<String, HmRssiInfo> getRssiInfo(HmInterface hmInterface) throws HomematicClientException;
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:5,代码来源:RpcClient.java


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