]> git.basschouten.com Git - openhab-addons.git/blob
e7dd794fad418453613964f810388ef833f96af0
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.hue.internal.config;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.binding.hue.internal.handler.HueBridgeHandler;
18
19 /**
20  * Configuration for the {@link HueBridgeHandler}.
21  *
22  * @author Christoph Weitkamp - Initial contribution
23  */
24 @NonNullByDefault
25 public class HueBridgeConfig {
26     public static final String HTTP = "http";
27     public static final String HTTPS = "https";
28
29     private @Nullable String ipAddress;
30     private @Nullable Integer port;
31     private String protocol = HTTP;
32     private @Nullable String userName;
33     private int pollingInterval = 10;
34     private int sensorPollingInterval = 500;
35
36     public @Nullable String getIpAddress() {
37         return ipAddress;
38     }
39
40     public void setIpAddress(String ipAddress) {
41         this.ipAddress = ipAddress;
42     }
43
44     public int getPort() {
45         Integer thePort = this.port;
46         return (thePort != null) ? thePort.intValue() : HTTPS.equals(protocol) ? 443 : 80;
47     }
48
49     public void setPort(int port) {
50         this.port = port;
51     }
52
53     public String getProtocol() {
54         return protocol;
55     }
56
57     public void setProtocol(String protocol) {
58         this.protocol = protocol;
59     }
60
61     public @Nullable String getUserName() {
62         return userName;
63     }
64
65     public void setUserName(String userName) {
66         this.userName = userName;
67     }
68
69     public int getPollingInterval() {
70         return pollingInterval;
71     }
72
73     public void setPollingInterval(int pollingInterval) {
74         this.pollingInterval = pollingInterval;
75     }
76
77     public int getSensorPollingInterval() {
78         return sensorPollingInterval;
79     }
80
81     public void setSensorPollingInterval(int sensorPollingInterval) {
82         this.sensorPollingInterval = sensorPollingInterval;
83     }
84 }