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.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";
27 public String clientId = "";
28 public String clientSecret = "";
29 public String webHookUrl = "";
30 public String webHookPostfix = "";
31 public int reconnectInterval = 300;
33 public ConfigurationLevel check(String refreshToken) {
34 if (clientId.isBlank()) {
35 return ConfigurationLevel.EMPTY_CLIENT_ID;
36 } else if (clientSecret.isBlank()) {
37 return ConfigurationLevel.EMPTY_CLIENT_SECRET;
38 } else if (refreshToken.isBlank()) {
39 return ConfigurationLevel.REFRESH_TOKEN_NEEDED;
41 return ConfigurationLevel.COMPLETED;