2 * Copyright (c) 2010-2024 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.mercedesme.internal.config;
15 import static org.openhab.binding.mercedesme.internal.Constants.*;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
20 * The {@link AccountConfiguration} class contains fields mapping thing configuration parameters.
22 * @author Bernd Weymann - Initial contribution
25 public class AccountConfiguration {
27 public String clientId = NOT_SET;
28 public String clientSecret = NOT_SET;
29 public String imageApiKey = NOT_SET;
31 // Advanced Parameters
32 public String callbackIP = NOT_SET;
33 public int callbackPort = -1;
34 public boolean odoScope = true;
35 public boolean vehicleScope = true;
36 public boolean lockScope = true;
37 public boolean fuelScope = true;
38 public boolean evScope = true;
40 // https://developer.mercedes-benz.com/products/electric_vehicle_status/docs#_required_scopes
41 public String getScope() {
42 StringBuffer sb = new StringBuffer();
43 sb.append(SCOPE_OPENID).append(SPACE).append(SCOPE_OFFLINE);
45 sb.append(SPACE).append(SCOPE_ODO);
48 sb.append(SPACE).append(SCOPE_STATUS);
51 sb.append(SPACE).append(SCOPE_LOCK);
54 sb.append(SPACE).append(SCOPE_FUEL);
57 sb.append(SPACE).append(SCOPE_EV);
63 public String toString() {
64 return "ID " + clientId + ", Secret " + clientSecret + ", IP " + callbackIP + ", Port " + callbackPort
65 + ", scope " + getScope();