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