Search in sources :

Example 1 with ApiRequest

use of org.openhab.binding.homeconnect.internal.client.model.ApiRequest in project openhab-addons by openhab.

the class HomeConnectServlet method getRequestLogPage.

private void getRequestLogPage(HttpServletRequest request, HttpServletResponse response) throws IOException {
    ArrayList<ApiRequest> requests = new ArrayList<>();
    bridgeHandlers.forEach(homeConnectBridgeHandler -> requests.addAll(homeConnectBridgeHandler.getApiClient().getLatestApiRequests()));
    WebContext context = new WebContext(request, response, request.getServletContext());
    context.setVariable("bridgeHandlers", bridgeHandlers);
    context.setVariable("requests", gson.toJson(requests));
    templateEngine.process("log-requests", context, response.getWriter());
}
Also used : WebContext(org.thymeleaf.context.WebContext) ArrayList(java.util.ArrayList) ApiRequest(org.openhab.binding.homeconnect.internal.client.model.ApiRequest)

Aggregations

ArrayList (java.util.ArrayList)1 ApiRequest (org.openhab.binding.homeconnect.internal.client.model.ApiRequest)1 WebContext (org.thymeleaf.context.WebContext)1