use of org.eclipse.smarthome.binding.homematic.internal.model.HmRssiInfo in project smarthome by eclipse.
the class RssiInfoParser method parse.
@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;
}
use of org.eclipse.smarthome.binding.homematic.internal.model.HmRssiInfo in project smarthome by eclipse.
the class AbstractHomematicGateway method loadRssiValues.
@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());
}
}
}
}
Aggregations