]> git.basschouten.com Git - openhab-addons.git/blob
b5393834cddec204dbe5fd66fe140943c7b717c6
[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.velux.internal.config;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * The {@link VeluxBridgeConfiguration} is a wrapper for
19  * configuration settings needed to access the
20  * {@link org.openhab.binding.velux.internal.bridge.VeluxBridgeProvider}
21  * device.
22  * <p>
23  * It contains the factory default values as well.
24  * <ul>
25  * <li>{@link VeluxBridgeConfiguration#protocol protocol} protocol type
26  * (one of http or https or slip),</li>
27  * <li>{@link VeluxBridgeConfiguration#ipAddress ipAddress} bridge IP address,</li>
28  * <li>{@link VeluxBridgeConfiguration#tcpPort tcpPort} bridge TCP port,</li>
29  * <li>{@link VeluxBridgeConfiguration#password password} bridge password,</li>
30  * <li>{@link VeluxBridgeConfiguration#timeoutMsecs timeoutMsecs} communication timeout in milliseconds,</li>
31  * <li>{@link VeluxBridgeConfiguration#retries retries} number of retries (with exponential backoff algorithm),</li>
32  * <li>{@link VeluxBridgeConfiguration#refreshMSecs refreshMSecs} refreshMSecs interval for retrieval of bridge
33  * information.</li>
34  * <li>{@link VeluxBridgeConfiguration#isBulkRetrievalEnabled isBulkRetrievalEnabled} flag to use bulk product</LI>
35  * <li>{@link VeluxBridgeConfiguration#isSequentialEnforced isSequentialEnforced} flag to enforce sequential control on
36  * actuators.</LI>
37  * <li>{@link VeluxBridgeConfiguration#isProtocolTraceEnabled isProtocolTraceEnabled} flag to enable protocol logging
38  * (via loglevel INFO).</li>
39  * </ul>
40  * <p>
41  *
42  * @author Guenther Schreiner - Initial contribution
43  */
44 @NonNullByDefault
45 public class VeluxBridgeConfiguration {
46     public static final String BRIDGE_PROTOCOL = "protocol";
47     public static final String BRIDGE_IPADDRESS = "ipAddress";
48     public static final String BRIDGE_TCPPORT = "tcpPort";
49     public static final String BRIDGE_PASSWORD = "password";
50     public static final String BRIDGE_TIMEOUT_MSECS = "timeoutMsecs";
51     public static final String BRIDGE_RETRIES = "retries";
52     public static final String BRIDGE_REFRESH_MSECS = "refreshMsecs";
53     public static final String BRIDGE_IS_BULK_RETRIEVAL_ENABLED = "isBulkRetrievalEnabled";
54     public static final String BRIDGE_IS_SEQUENTIAL_ENFORCED = "isSequentialEnforced";
55     public static final String BRIDGE_PROTOCOL_TRACE_ENABLED = "isProtocolTraceEnabled";
56
57     /*
58      * Value to flag any changes towards the getter.
59      */
60     public boolean hasChanged = true;
61
62     /*
63      * Default values - should not be modified
64      */
65     public String protocol = "slip";
66     public String ipAddress = "192.168.1.1";
67     public int tcpPort = 51200;
68     public String password = "velux123";
69     public int timeoutMsecs = 1000; // one second
70     public int retries = 5;
71     public long refreshMSecs = 10000L; // 10 seconds
72     public boolean isBulkRetrievalEnabled = true;
73     public boolean isSequentialEnforced = false;
74     public boolean isProtocolTraceEnabled = false;
75 }