2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.vektiva.internal.net;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.eclipse.jetty.websocket.api.WebSocketAdapter;
18 import org.openhab.binding.vektiva.internal.handler.VektivaSmarwiHandler;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
23 * The {@link VektivaSmarwiSocket} class defines websocket used for connection with
26 * @author Ondrej Pecta - Initial contribution
29 public class VektivaSmarwiSocket extends WebSocketAdapter {
30 private final Logger logger = LoggerFactory.getLogger(VektivaSmarwiSocket.class);
31 private final VektivaSmarwiHandler handler;
33 public VektivaSmarwiSocket(VektivaSmarwiHandler handler) {
34 this.handler = handler;
38 public void onWebSocketText(@Nullable String message) {
39 super.onWebSocketText(message);
40 if (message != null) {
41 logger.trace("Got message: {}", message);
42 handler.processStatusResponse(message);