2 * Copyright (c) 2010-2023 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.mystrom.internal;
15 import static org.openhab.binding.mystrom.internal.MyStromBindingConstants.*;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
20 * The {@link MyStromConfiguration} class contains fields mapping thing configuration parameters.
22 * @author Paul Frank - Initial contribution
23 * @author Stefan Navratil - Added configuration for myStrom PIR
26 public class MyStromConfiguration {
28 private final String urlPrefix = "http://";
30 private String hostname = "localhost";
32 private String apiToken = "";
34 private int refresh = DEFAULT_REFRESH_RATE_SECONDS;
36 private int backoffTime = DEFAULT_BACKOFF_TIME_SECONDS;
38 private boolean ledEnable = true;
41 * Returns the hostname with http prefix if missing.
45 public String getHostname() {
47 if (!this.hostname.contains(urlPrefix)) {
50 return prefix + this.hostname;
58 public String getApiToken() {
63 * Returns the refreshrate in SECONDS.
67 public int getRefresh() {
72 * Returns the Backoff time of the MotionSensor in SECONDS.
74 * @return backoff_time
76 public int getBackoffTime() {
81 * Returns the Status LED Configuration.
85 public boolean getLedEnable() {