Updated broadlink discover and fixed list mapping issue. Added refresh

to ResourceHAndlers so Broadlink and Lifx can be refreshed from the tab.
This commit is contained in:
bsamuels
2018-02-08 15:30:21 -06:00
parent 5a73cc20a9
commit 869ffaaf36
27 changed files with 238 additions and 88 deletions

View File

@@ -338,6 +338,14 @@ public class DeviceResource {
return new DeviceMapTypes().getDeviceMapTypes();
}, new JsonTransformer());
get (API_CONTEXT + "/refresh/:typeIndex", "application/json", (request, response) -> {
String typeIndex = request.params(":typeIndex");
log.debug("Refresh Home: " + typeIndex);
response.status(HttpStatus.SC_OK);
homeManager.findResource(typeIndex).refresh();
return null;
}, new JsonTransformer());
// http://ip_address:port/api/devices/exec/renumber CORS request
options(API_CONTEXT + "/exec/renumber", "application/json", (request, response) -> {
response.status(HttpStatus.SC_OK);