]> git.basschouten.com Git - openhab-addons.git/blob
448b5cd0479eabc76ad88d964b7d79dae4a8e378
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 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      */
71     public void controllerOffline();
72
73     /**
74      * Called to indicate the connection with the Niko Home Control Controller is online.
75      *
76      */
77     public void controllerOnline();
78
79     /**
80      * This method is called when an alarm event is received from the Niko Home Control controller.
81      *
82      * @param alarmText
83      */
84     public void alarmEvent(String alarmText);
85
86     /**
87      * This method is called when a notice event is received from the Niko Home Control controller.
88      *
89      * @param alarmText
90      */
91     public void noticeEvent(String noticeText);
92
93     /**
94      * This method is called when properties are updated from from the Niko Home Control controller.
95      */
96     public void updatePropertiesEvent();
97 }