]> git.basschouten.com Git - openhab-addons.git/blob
6294207ba07008b11d9f0fc949dfe6378d23cf17
[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.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     public @Nullable String ipAddress;
30     public @Nullable Integer port;
31     public String protocol = HTTPS;
32     public boolean useSelfSignedCertificate = true;
33     public @Nullable String userName;
34     public int pollingInterval = 10;
35     public int sensorPollingInterval = 500;
36
37     public int getPort() {
38         Integer thePort = port;
39         return (thePort != null) ? thePort.intValue() : HTTPS.equals(protocol) ? 443 : 80;
40     }
41 }