2 * Copyright (c) 2010-2024 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.samsungtv.internal.service.api;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.io.net.http.WebSocketFactory;
17 import org.openhab.core.thing.ThingStatusDetail;
18 import org.openhab.core.types.State;
21 * Interface for receiving data from Samsung TV services.
23 * @author Pauli Anttila - Initial contribution
24 * @author Arjan Mels - Added methods to put/get configuration
27 public interface EventListener {
29 * Invoked when value is received from the TV.
31 * @param variable Name of the variable.
32 * @param value Value of the variable value.
34 void valueReceived(String variable, State value);
37 * Report an error to this event listener
39 * @param statusDetail hint about the actual underlying problem
40 * @param message of the error
41 * @param e exception that might have occurred
43 void reportError(ThingStatusDetail statusDetail, String message, Throwable e);
46 * Get configuration item
48 * @param key key of configuration item
49 * @param value value of key
51 void putConfig(String key, Object value);
54 * Put configuration item
56 * @param key key of configuration item
57 * @return value of key
59 Object getConfig(String key);
62 * Get WebSocket Factory
64 * @return WebSocket Factory
66 WebSocketFactory getWebSocketFactory();