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