]> git.basschouten.com Git - openhab-addons.git/blob
089ac6661f4036e48f793c01aeb3a8a316d1f78a
[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.neeo.internal;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.binding.neeo.internal.handler.NeeoBrainHandler;
18
19 /**
20  * The configuration class a neeo brain and used by {@link NeeoBrainHandler}
21  *
22  * @author Tim Roberts - initial contribution
23  */
24 @NonNullByDefault
25 public class NeeoBrainConfig {
26
27     /** The ip address */
28     @Nullable
29     private String ipAddress;
30
31     /** Whether to enable forward actions */
32     private boolean enableForwardActions;
33
34     /** The forward actions chain (comma delimited) */
35     @Nullable
36     private String forwardChain;
37
38     /** Whether to discover empty rooms or not */
39     private boolean discoverEmptyRooms;
40
41     /** The check status interval (in seconds) */
42     private int checkStatusInterval;
43
44     /**
45      * Gets the ip address.
46      *
47      * @return the ip address
48      */
49     @Nullable
50     public String getIpAddress() {
51         return ipAddress;
52     }
53
54     /**
55      * Sets the ip address.
56      *
57      * @param ipAddress the new ip address
58      */
59     public void setIpAddress(String ipAddress) {
60         this.ipAddress = ipAddress;
61     }
62
63     /**
64      * Determines if forward actions is enabled
65      *
66      * @return true for enabled, false otherwise
67      */
68     public boolean isEnableForwardActions() {
69         return enableForwardActions;
70     }
71
72     /**
73      * Sets whether to enable forward actions
74      *
75      * @param enableForwardActions true to enable, false otherwise
76      */
77     public void setEnableForwardActions(boolean enableForwardActions) {
78         this.enableForwardActions = enableForwardActions;
79     }
80
81     /**
82      * Get's the forward chain
83      *
84      * @return the forward chain
85      */
86     @Nullable
87     public String getForwardChain() {
88         return forwardChain;
89     }
90
91     /**
92      * Sets the forward change
93      *
94      * @param forwardChain the forward chain
95      */
96     public void setForwardChain(String forwardChain) {
97         this.forwardChain = forwardChain;
98     }
99
100     /**
101      * Whether empty rooms should be discovered or not
102      *
103      * @return true to discover empty rooms, false otherwise
104      */
105     public boolean isDiscoverEmptyRooms() {
106         return discoverEmptyRooms;
107     }
108
109     /**
110      * Set's whether to discover empty rooms
111      *
112      * @param discoverEmptyRooms true to discover, false otherwise
113      */
114     public void setDiscoverEmptyRooms(boolean discoverEmptyRooms) {
115         this.discoverEmptyRooms = discoverEmptyRooms;
116     }
117
118     /**
119      * Gets the interval (in seconds) to check the brain status
120      *
121      * @return the check status interval (negative to disable)
122      */
123     public int getCheckStatusInterval() {
124         return checkStatusInterval;
125     }
126
127     /**
128      * Sets the interval (in seconds) to check the brain status
129      *
130      * @param checkStatusInterval return the check status interval (negative to disable)
131      */
132     public void setCheckStatusInterval(int checkStatusInterval) {
133         this.checkStatusInterval = checkStatusInterval;
134     }
135
136     @Override
137     public String toString() {
138         return "NeeoBrainConfig{" + "ipAddress='" + ipAddress + '\'' + ", enableForwardActions=" + enableForwardActions
139                 + ", forwardChain='" + forwardChain + '\'' + ", discoverEmptyRooms=" + discoverEmptyRooms
140                 + ", checkStatusInterval=" + checkStatusInterval + '}';
141     }
142 }