update for changes

This commit is contained in:
bsamuels
2018-01-16 16:13:24 -06:00
parent 27dd8475e9
commit 18c47ee5e4
7 changed files with 37 additions and 7 deletions

View File

@@ -31,7 +31,6 @@ public class FHEMInstance {
}
public Boolean callCommand(String aCommand, String commandData, HTTPHandler httpClient) {
log.debug("calling FHEM: " + theFhem.getIp() + ":" + theFhem.getPort() + aCommand);
String aUrl = null;
NameValue[] headers = null;
if(theFhem.getSecure() != null && theFhem.getSecure())
@@ -41,9 +40,11 @@ public class FHEMInstance {
if(theFhem.getUsername() != null && !theFhem.getUsername().isEmpty() && theFhem.getPassword() != null && !theFhem.getPassword().isEmpty()) {
aUrl = aUrl + theFhem.getUsername() + ":" + theFhem.getPassword() + "@";
}
aUrl = aUrl + theFhem.getIp() + ":" + theFhem.getPort() + "/" + aCommand;
String theData = httpClient.doHttpRequest(aUrl, HttpPost.METHOD_NAME, "text/plain", commandData, headers);
log.debug("call Command return is: <" + theData + ">");
aUrl = aUrl + theFhem.getIp() + ":" + theFhem.getPort() + "/" + aCommand + "/" + commandData;
log.debug("calling FHEM: " + aUrl);
String theData = httpClient.doHttpRequest(aUrl, HttpPost.METHOD_NAME, "text/plain", null, headers);
if(theData != null)
log.debug("doHttpRequest returned data: <" + theData + ">");
return true;
}