]> git.basschouten.com Git - openhab-addons.git/blob
dd375bd1d4b8f06916195b0cd63c8fc01856732d
[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     public int timeout = 2000;
30     public int websocketTimeout = 120;
31
32     public String getHostWithoutPort() {
33         String hostWithoutPort = host;
34         if (hostWithoutPort.indexOf(':') > 0) {
35             hostWithoutPort = hostWithoutPort.substring(0, hostWithoutPort.indexOf(':'));
36         }
37         return hostWithoutPort;
38     }
39 }