Merge pull request #625 from ahertz/logitech_pop

Added error message for scene invocation, to allow Logitech Pop to work.
This commit is contained in:
BWS Systems
2017-05-10 11:17:54 -05:00
committed by GitHub

View File

@@ -118,6 +118,17 @@ public class HueMulator {
log.debug("group add requested from " + request.ip() + " user " + request.params(":userid") + " with body " + request.body());
return "[{\"success\":{\"id\":\"1\"}}]";
});
// http://ip_address:port/api/:userid/groups/<groupid>/action
// Dummy handler
// Error forces Logitech Pop to fall back to individual light control
// instead of scene-based control.
put(HUE_CONTEXT + "/:userid/groups/:groupid/action", "application/json", (request, response) -> {
response.header("Access-Control-Allow-Origin", request.headers("Origin"));
response.type("application/json");
response.status(HttpStatus.SC_OK);
log.debug("put to groups API from " + request.ip() + " user " + request.params(":userid") + " with body " + request.body());
return "[{\"error\":{\"address\": \"/groups/0/action/scene\", \"type\":7, \"description\": \"invalid value, dummy for parameter, scene\"}}]";
});
// http://ip_address:port/api/{userId}/scenes returns json objects of
// all scenes configured
get(HUE_CONTEXT + "/:userid/scenes", "application/json", (request, response) -> {