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