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.mybmw.internal.utils;
15 import java.util.List;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
21 * The {@link BimmerConstants} This class holds the important constants for the BMW Connected Drive Authorization. They
22 * are taken from the Bimmercode from github {@link https://github.com/bimmerconnected/bimmer_connected}
23 * File defining these constants
24 * {@link https://github.com/bimmerconnected/bimmer_connected/blob/master/bimmer_connected/account.py}
25 * https://customer.bmwgroup.com/one/app/oauth.js
27 * @author Bernd Weymann - Initial contribution
30 public class BimmerConstants {
32 public static final String REGION_NORTH_AMERICA = "NORTH_AMERICA";
33 public static final String REGION_CHINA = "CHINA";
34 public static final String REGION_ROW = "ROW";
36 public static final String BRAND_BMW = "bmw";
37 public static final String BRAND_MINI = "mini";
38 public static final List<String> ALL_BRANDS = List.of(BRAND_BMW, BRAND_MINI);
40 public static final String OAUTH_ENDPOINT = "/gcdm/oauth/authenticate";
42 public static final String EADRAX_SERVER_NORTH_AMERICA = "cocoapi.bmwgroup.us";
43 public static final String EADRAX_SERVER_ROW = "cocoapi.bmwgroup.com";
44 public static final String EADRAX_SERVER_CHINA = "myprofile.bmw.com.cn";
45 public static final Map<String, String> EADRAX_SERVER_MAP = Map.of(REGION_NORTH_AMERICA,
46 EADRAX_SERVER_NORTH_AMERICA, REGION_CHINA, EADRAX_SERVER_CHINA, REGION_ROW, EADRAX_SERVER_ROW);
48 public static final String OCP_APIM_KEY_NORTH_AMERICA = "31e102f5-6f7e-7ef3-9044-ddce63891362";
49 public static final String OCP_APIM_KEY_ROW = "4f1c85a3-758f-a37d-bbb6-f8704494acfa";
50 public static final Map<String, String> OCP_APIM_KEYS = Map.of(REGION_NORTH_AMERICA, OCP_APIM_KEY_NORTH_AMERICA,
51 REGION_ROW, OCP_APIM_KEY_ROW);
53 public static final String CHINA_PUBLIC_KEY = "/eadrax-coas/v1/cop/publickey";
54 public static final String CHINA_LOGIN = "/eadrax-coas/v1/login/pwd";
57 public static final String USER_AGENT = "Dart/2.14 (dart:io)";
58 public static final String X_USER_AGENT = "android(SP1A.210812.016.C1);%s;2.5.2(14945);%s";
60 public static final String LOGIN_NONCE = "login_nonce";
61 public static final String AUTHORIZATION_CODE = "authorization_code";
63 // Parameters for API Requests
64 public static final String TIRE_GUARD_MODE = "tireGuardMode";
65 public static final String APP_DATE_TIME = "appDateTime";
66 public static final String APP_TIMEZONE = "apptimezone";
69 public static final String API_OAUTH_CONFIG = "/eadrax-ucs/v1/presentation/oauth/config";
70 public static final String API_VEHICLES = "/eadrax-vcs/v1/vehicles";
71 public static final String API_REMOTE_SERVICE_BASE_URL = "/eadrax-vrccs/v2/presentation/remote-commands/"; // '/{vin}/{service_type}'
72 public static final String API_POI = "/eadrax-dcs/v1/send-to-car/send-to-car";