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.wlanthermo.internal;
16 import java.net.URISyntaxException;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
22 * The {@link WlanThermoNanoConfiguration} class contains fields mapping thing configuration parameters.
24 * @author Christian Schlipp - Initial contribution
27 public class WlanThermoNanoConfiguration {
30 * IP Address of WlanThermo.
32 private String ipAddress = "";
35 * Username of WlanThermo user.
37 private @Nullable String username;
40 * Password of WlanThermo user.
43 private @Nullable String password;
48 private int pollingInterval = 10;
50 public String getIpAddress() {
54 public URI getUri(String path) throws URISyntaxException {
55 String uri = ipAddress;
56 if (!uri.startsWith("http://")) {
57 uri = "http://" + uri;
60 if (!path.startsWith("/") && !uri.endsWith("/")) {
68 public URI getUri() throws URISyntaxException {
72 public void setIpAddress(String ipAddress) {
73 this.ipAddress = ipAddress;
77 public String getUsername() {
81 public void setUsername(String username) {
82 this.username = username;
86 public String getPassword() {
90 public void setPassword(String password) {
91 this.password = password;
94 public int getPollingInterval() {
95 return pollingInterval;
98 public void setPollingInterval(int pollingInterval) {
99 this.pollingInterval = pollingInterval;