]> git.basschouten.com Git - openhab-addons.git/blob
bb8394812dfc5167d419dcc99dd4851aa55779fa
[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.deconz.internal.handler;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  * The {@link DeconzBridgeConfig} class holds the configuration properties of the bridge.
20  *
21  * @author David Graeff - Initial contribution
22  */
23 @NonNullByDefault
24 public class DeconzBridgeConfig {
25     public String host = "";
26     public int httpPort = 80;
27     public int port = 0;
28     public @Nullable String apikey;
29     int timeout = 2000;
30
31     public String getHostWithoutPort() {
32         String hostWithoutPort = host;
33         if (hostWithoutPort.indexOf(':') > 0) {
34             hostWithoutPort = hostWithoutPort.substring(0, hostWithoutPort.indexOf(':'));
35         }
36         return hostWithoutPort;
37     }
38 }