use of org.openhab.binding.homematic.internal.binrpc.BinRpcRequest in project openhab1-addons by openhab.
the class BinRpcClient method getRssiInfo.
/**
* {@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;
}
use of org.openhab.binding.homematic.internal.binrpc.BinRpcRequest in project openhab1-addons by openhab.
the class BinRpcClient method release.
/**
* {@inheritDoc}
*/
@Override
public void release(HmInterface hmInterface) throws HomematicClientException {
BinRpcRequest request = new BinRpcRequest("init");
request.addArg(context.getConfig().getBinRpcCallbackUrl());
sendMessage(hmInterface, request);
}
use of org.openhab.binding.homematic.internal.binrpc.BinRpcRequest in project openhab1-addons by openhab.
the class BinRpcClient method executeProgram.
/**
* {@inheritDoc}
*/
@Override
public void executeProgram(HmInterface hmInterface, String programName) throws HomematicClientException {
BinRpcRequest request = new BinRpcRequest("runScript");
request.addArg(programName);
sendMessage(hmInterface, request);
}
Aggregations