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.hue.internal.config;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.binding.hue.internal.handler.HueBridgeHandler;
20 * Configuration for the {@link HueBridgeHandler}.
22 * @author Christoph Weitkamp - Initial contribution
25 public class HueBridgeConfig {
26 public static final String HTTP = "http";
27 public static final String HTTPS = "https";
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;
36 public @Nullable String getIpAddress() {
40 public void setIpAddress(String ipAddress) {
41 this.ipAddress = ipAddress;
44 public int getPort() {
45 Integer thePort = this.port;
46 return (thePort != null) ? thePort.intValue() : HTTPS.equals(protocol) ? 443 : 80;
49 public void setPort(int port) {
53 public String getProtocol() {
57 public void setProtocol(String protocol) {
58 this.protocol = protocol;
61 public @Nullable String getUserName() {
65 public void setUserName(String userName) {
66 this.userName = userName;
69 public int getPollingInterval() {
70 return pollingInterval;
73 public void setPollingInterval(int pollingInterval) {
74 this.pollingInterval = pollingInterval;
77 public int getSensorPollingInterval() {
78 return sensorPollingInterval;
81 public void setSensorPollingInterval(int sensorPollingInterval) {
82 this.sensorPollingInterval = sensorPollingInterval;