From 4e447706d345802a8447d59acf158fee894c496e Mon Sep 17 00:00:00 2001 From: Jordan Hackworth Date: Tue, 7 Jul 2015 17:02:46 -0700 Subject: [PATCH] Logitech Harmony Support --- src/main/java/com/armzilla/ha/hue/HueMulator.java | 5 +++++ src/main/java/com/armzilla/ha/upnp/UpnpListener.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/armzilla/ha/hue/HueMulator.java b/src/main/java/com/armzilla/ha/hue/HueMulator.java index e80841f..8115ec5 100644 --- a/src/main/java/com/armzilla/ha/hue/HueMulator.java +++ b/src/main/java/com/armzilla/ha/hue/HueMulator.java @@ -63,6 +63,11 @@ public ResponseEntity> getUpnpConfiguration(@PathVariable(va return new ResponseEntity<>(deviceResponseMap, null, HttpStatus.OK); } + @RequestMapping(value = "/*", method = RequestMethod.POST, produces = "application/json") + public ResponseEntity postAPI(HttpServletRequest request) { + return new ResponseEntity("[{\"success\":{\"username\":\"lights\"}}]", HttpStatus.OK); + } + @RequestMapping(value = "/{userId}", method = RequestMethod.GET, produces = "application/json") public ResponseEntity getApi(@PathVariable(value = "userId") String userId, HttpServletRequest request) { log.info("hue api root requested: " + userId + " from " + request.getRemoteAddr()); diff --git a/src/main/java/com/armzilla/ha/upnp/UpnpListener.java b/src/main/java/com/armzilla/ha/upnp/UpnpListener.java index 1afb965..00e59ec 100644 --- a/src/main/java/com/armzilla/ha/upnp/UpnpListener.java +++ b/src/main/java/com/armzilla/ha/upnp/UpnpListener.java @@ -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());