]> git.basschouten.com Git - openhab-addons.git/blob
be327fa238e4e6b4f0322bdfa9cd07f387eec97f
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.nikohomecontrol.internal.protocol;
14
15 import java.net.InetAddress;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19
20 /**
21  * The {@link NhcControllerEvent} interface is used to get configuration information and to pass alarm or notice events
22  * received from the Niko Home Control controller to the consuming client. It is designed to pass events to openHAB
23  * handlers that implement this interface. Because of the design, the
24  * org.openhab.binding.nikohomecontrol.internal.protocol package can be extracted and used independent of openHAB.
25  *
26  * @author Mark Herwege - Initial Contribution
27  */
28 @NonNullByDefault
29 public interface NhcControllerEvent {
30
31     /**
32      * Get the IP-address of the Niko Home Control IP-interface.
33      *
34      * @return the addr
35      */
36     public default @Nullable InetAddress getAddr() {
37         return null;
38     }
39
40     /**
41      * Get the listening port of the Niko Home Control IP-interface.
42      *
43      * @return the port
44      */
45     public default int getPort() {
46         return 0;
47     }
48
49     /**
50      * Get the profile for the hobby API in the Niko Home Control II system.
51      *
52      * @return the profile
53      */
54     public default String getProfile() {
55         return "";
56     }
57
58     /**
59      * Get the JWT Token of the Niko Home Control II system.
60      *
61      * @return the token
62      */
63     public default String getToken() {
64         return "";
65     }
66
67     /**
68      * Called to indicate the connection with the Niko Home Control Controller is offline.
69      *
70      * @param message
71      */
72     public void controllerOffline(String message);
73
74     /**
75      * Called to indicate the connection with the Niko Home Control Controller is online.
76      *
77      */
78     public void controllerOnline();
79
80     /**
81      * This method is called when an alarm event is received from the Niko Home Control controller.
82      *
83      * @param alarmText
84      */
85     public void alarmEvent(String alarmText);
86
87     /**
88      * This method is called when a notice event is received from the Niko Home Control controller.
89      *
90      * @param alarmText
91      */
92     public void noticeEvent(String noticeText);
93
94     /**
95      * This method is called when properties are updated from from the Niko Home Control controller.
96      */
97     public void updatePropertiesEvent();
98 }