2 * Copyright (c) 2010-2021 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.atlona.internal.pro3;
15 import org.openhab.binding.atlona.internal.discovery.AtlonaDiscovery;
18 * Configuration class for the Atlona Pro3 line of switchers
20 * @author Tim Roberts - Initial contribution
22 public class AtlonaPro3Config {
25 * Constant field used in {@link AtlonaDiscovery} to set the config property during discovery. Value of this field
26 * needs to match {@link #ipAddress}
28 public static final String IP_ADDRESS = "ipAddress";
31 * IP Address (or host name) of switch
33 private String ipAddress;
36 * Optional username to login in with. Only used if the switch has it's "Telnet Login" option turned on
38 private String userName;
41 * Optional password to login in with. Only used if the switch has it's "Telnet Login" option turned on
43 private String password;
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)
52 * Ping time (in seconds) to keep the connection alive. Should be less than the IP Timeout on the switch.
57 * Polling time (in seconds) to attempt a reconnect if the socket session has failed
59 private int retryPolling;
62 * Returns the IP address or host name of the switch
64 * @return the IP address or host name of the swtich
66 public String getIpAddress() {
71 * Sets the IP address or host name of the switch
73 * @param ipAddress the IP Address or host name of the switch
75 public void setIpAddress(String ipAddress) {
76 this.ipAddress = ipAddress;
80 * Gets the username used to login with
82 * @return the username used to login with
84 public String getUserName() {
89 * Sets the username used to login with
91 * @param userName the username used to login with
93 public void setUserName(String userName) {
94 this.userName = userName;
98 * Gets the password used to login with
100 * @return the password used to login with
102 public String getPassword() {
107 * Sets the password used to login with
109 * @param password the password used to login with
111 public void setPassword(String password) {
112 this.password = password;
116 * Gets the polling (in seconds) to refresh state
118 * @return the polling (in seconds) to refresh state
120 public int getPolling() {
125 * Sets the polling (in seconds) to refresh state
127 * @param polling the polling (in seconds) to refresh state
129 public void setPolling(int polling) {
130 this.polling = polling;
134 * Gets the polling (in seconds) to reconnect
136 * @return the polling (in seconds) to reconnect
138 public int getRetryPolling() {
143 * Sets the polling (in seconds) to reconnect
145 * @param retryPolling the polling (in seconds to reconnect)
147 public void setRetryPolling(int retryPolling) {
148 this.retryPolling = retryPolling;
152 * Gets the ping interval (in seconds)
154 * @return the ping interval (in seconds)
156 public int getPing() {
161 * Sets the ping interval (in seconds)
163 * @param ping the ping interval (in seconds)
165 public void setPing(int ping) {