]> git.basschouten.com Git - openhab-addons.git/blob
dfa92a798194ef137ac07b0b03dc161b14973a26
[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
18 /**
19  * Configuration for the {@link org.openhab.binding.hue.internal.handler.HueBridgeHandler}.
20  *
21  * @author Christoph Weitkamp - Initial contribution
22  */
23 @NonNullByDefault
24 public class HueBridgeConfig {
25     public static final String HTTP = "http";
26     public static final String HTTPS = "https";
27
28     public @Nullable String ipAddress;
29     public @Nullable Integer port;
30     public String protocol = HTTPS;
31     public boolean useSelfSignedCertificate = true;
32     public @Nullable String userName;
33     public int pollingInterval = 10;
34     public int sensorPollingInterval = 500;
35
36     public int getPort() {
37         Integer thePort = port;
38         return (thePort != null) ? thePort.intValue() : HTTPS.equals(protocol) ? 443 : 80;
39     }
40 }