2 * Copyright (c) 2010-2022 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.netatmo.internal.config;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
18 * The {@link ApiHandlerConfiguration} is responsible for holding configuration
19 * information needed to access Netatmo API and general binding behavior setup
21 * @author Gaƫl L'hopital - Initial contribution
24 public class ApiHandlerConfiguration {
25 public static final String CLIENT_ID = "clientId";
26 public static final String REFRESH_TOKEN = "refreshToken";
28 public String clientId = "";
29 public String clientSecret = "";
30 public String refreshToken = "";
31 public String webHookUrl = "";
32 public int reconnectInterval = 300;
34 public ConfigurationLevel check() {
35 if (clientId.isBlank()) {
36 return ConfigurationLevel.EMPTY_CLIENT_ID;
37 } else if (clientSecret.isBlank()) {
38 return ConfigurationLevel.EMPTY_CLIENT_SECRET;
39 } else if (refreshToken.isBlank()) {
40 return ConfigurationLevel.REFRESH_TOKEN_NEEDED;
42 return ConfigurationLevel.COMPLETED;