]> git.basschouten.com Git - openhab-addons.git/blob
bde5cdb823c508964a7281de3cca25aa820b765b
[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.atlona.internal.pro3;
14
15 /**
16  * Configuration class for the Atlona Pro3 line of switchers
17  *
18  * @author Tim Roberts - Initial contribution
19  */
20 public class AtlonaPro3Config {
21
22     /**
23      * Constant field used in {@link org.openhab.binding.atlona.internal.discovery.AtlonaDiscovery}
24      * to set the config property during discovery. Value of this field
25      * needs to match {@link #ipAddress}
26      */
27     public static final String IP_ADDRESS = "ipAddress";
28
29     /**
30      * IP Address (or host name) of switch
31      */
32     private String ipAddress;
33
34     /**
35      * Optional username to login in with. Only used if the switch has it's "Telnet Login" option turned on
36      */
37     private String userName;
38
39     /**
40      * Optional password to login in with. Only used if the switch has it's "Telnet Login" option turned on
41      */
42     private String password;
43
44     /**
45      * Polling time (in seconds) to refresh state from the switch itself. Only useful if something else modifies the
46      * switch (usually through the front panel or the IR link)
47      */
48     private int polling;
49
50     /**
51      * Ping time (in seconds) to keep the connection alive. Should be less than the IP Timeout on the switch.
52      */
53     private int ping;
54
55     /**
56      * Polling time (in seconds) to attempt a reconnect if the socket session has failed
57      */
58     private int retryPolling;
59
60     /**
61      * Returns the IP address or host name of the switch
62      *
63      * @return the IP address or host name of the swtich
64      */
65     public String getIpAddress() {
66         return ipAddress;
67     }
68
69     /**
70      * Sets the IP address or host name of the switch
71      *
72      * @param ipAddress the IP Address or host name of the switch
73      */
74     public void setIpAddress(String ipAddress) {
75         this.ipAddress = ipAddress;
76     }
77
78     /**
79      * Gets the username used to login with
80      *
81      * @return the username used to login with
82      */
83     public String getUserName() {
84         return userName;
85     }
86
87     /**
88      * Sets the username used to login with
89      *
90      * @param userName the username used to login with
91      */
92     public void setUserName(String userName) {
93         this.userName = userName;
94     }
95
96     /**
97      * Gets the password used to login with
98      *
99      * @return the password used to login with
100      */
101     public String getPassword() {
102         return password;
103     }
104
105     /**
106      * Sets the password used to login with
107      *
108      * @param password the password used to login with
109      */
110     public void setPassword(String password) {
111         this.password = password;
112     }
113
114     /**
115      * Gets the polling (in seconds) to refresh state
116      *
117      * @return the polling (in seconds) to refresh state
118      */
119     public int getPolling() {
120         return polling;
121     }
122
123     /**
124      * Sets the polling (in seconds) to refresh state
125      *
126      * @param polling the polling (in seconds) to refresh state
127      */
128     public void setPolling(int polling) {
129         this.polling = polling;
130     }
131
132     /**
133      * Gets the polling (in seconds) to reconnect
134      *
135      * @return the polling (in seconds) to reconnect
136      */
137     public int getRetryPolling() {
138         return retryPolling;
139     }
140
141     /**
142      * Sets the polling (in seconds) to reconnect
143      *
144      * @param retryPolling the polling (in seconds to reconnect)
145      */
146     public void setRetryPolling(int retryPolling) {
147         this.retryPolling = retryPolling;
148     }
149
150     /**
151      * Gets the ping interval (in seconds)
152      *
153      * @return the ping interval (in seconds)
154      */
155     public int getPing() {
156         return ping;
157     }
158
159     /**
160      * Sets the ping interval (in seconds)
161      *
162      * @param ping the ping interval (in seconds)
163      */
164     public void setPing(int ping) {
165         this.ping = ping;
166     }
167 }