Skip to content

Commit

Permalink
Merge pull request #17 from Hackworth/master
Browse files Browse the repository at this point in the history
Logitech Harmony Support
  • Loading branch information
armzilla committed Jul 13, 2015
2 parents 27f75be + 4e44770 commit cbb0e76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/main/java/com/armzilla/ha/hue/HueMulator.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ public ResponseEntity<Map<String, String>> getUpnpConfiguration(@PathVariable(va
return new ResponseEntity<>(deviceResponseMap, null, HttpStatus.OK);
}

@RequestMapping(value = "/*", method = RequestMethod.POST, produces = "application/json")
public ResponseEntity<String> postAPI(HttpServletRequest request) {
return new ResponseEntity<String>("[{\"success\":{\"username\":\"lights\"}}]", HttpStatus.OK);
}

@RequestMapping(value = "/{userId}", method = RequestMethod.GET, produces = "application/json")
public ResponseEntity<HueApiResponse> getApi(@PathVariable(value = "userId") String userId, HttpServletRequest request) {
log.info("hue api root requested: " + userId + " from " + request.getRemoteAddr());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/armzilla/ha/upnp/UpnpListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected boolean isSSDPDiscovery(String body){
"LOCATION: http://%s:%s/upnp/amazon-ha-bridge/setup.xml\r\n" +
"OPT: \"http://schemas.upnp.org/upnp/1/0/\"; ns=01\r\n" +
"01-NLS: %s\r\n" +
"ST: urn:Belkin:device:**\r\n" +
"ST: urn:schemas-upnp-org:device:basic:1\r\n" +
"USN: uuid:Socket-1_0-221438K0100073::urn:Belkin:device:**\r\n\r\n";
protected void sendUpnpResponse(DatagramSocket socket, InetAddress requester, int sourcePort) throws IOException {
String discoveryResponse = String.format(discoveryTemplate, responseAddress, httpServerPort, getRandomUUIDString());
Expand Down

0 comments on commit cbb0e76

Please sign in to comment.