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