]> git.basschouten.com Git - openhab-addons.git/blob
f806b26c6ce35faad624e1cdd8fe35e491530096
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.samsungtv.internal.service.api;
14
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;
19
20 /**
21  * Interface for receiving data from Samsung TV services.
22  *
23  * @author Pauli Anttila - Initial contribution
24  * @author Arjan Mels - Added methods to put/get configuration
25  */
26 @NonNullByDefault
27 public interface EventListener {
28     /**
29      * Invoked when value is received from the TV.
30      *
31      * @param variable Name of the variable.
32      * @param value Value of the variable value.
33      */
34     void valueReceived(String variable, State value);
35
36     /**
37      * Report an error to this event listener
38      *
39      * @param statusDetail hint about the actual underlying problem
40      * @param message of the error
41      * @param e exception that might have occurred
42      */
43     void reportError(ThingStatusDetail statusDetail, String message, Throwable e);
44
45     /**
46      * Get configuration item
47      *
48      * @param key key of configuration item
49      * @param value value of key
50      */
51     void putConfig(String key, Object value);
52
53     /**
54      * Put configuration item
55      *
56      * @param key key of configuration item
57      * @return value of key
58      */
59     Object getConfig(String key);
60
61     /**
62      * Get WebSocket Factory
63      *
64      * @return WebSocket Factory
65      */
66     WebSocketFactory getWebSocketFactory();
67 }