]> git.basschouten.com Git - openhab-addons.git/blob
7284c6411b95a92b98aff2d1c786f7c1eb5f6bb4
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.mybmw.internal.utils;
14
15 import java.util.List;
16 import java.util.Map;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19
20 /**
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 <a href="https://github.com/bimmerconnected/bimmer_connected">
23  * https://github.com/bimmerconnected/bimmer_connected</a>.
24  * File defining these constants
25  * <a href="https://github.com/bimmerconnected/bimmer_connected/blob/master/bimmer_connected/account.py">
26  * https://github.com/bimmerconnected/bimmer_connected/blob/master/bimmer_connected/account.py</a>
27  * <a href="https://customer.bmwgroup.com/one/app/oauth.js">https://customer.bmwgroup.com/one/app/oauth.js</a>
28  *
29  * @author Bernd Weymann - Initial contribution
30  */
31 @NonNullByDefault
32 public class BimmerConstants {
33
34     public static final String REGION_NORTH_AMERICA = "NORTH_AMERICA";
35     public static final String REGION_CHINA = "CHINA";
36     public static final String REGION_ROW = "ROW";
37
38     public static final String BRAND_BMW = "bmw";
39     public static final String BRAND_MINI = "mini";
40     public static final List<String> ALL_BRANDS = List.of(BRAND_BMW, BRAND_MINI);
41
42     public static final String OAUTH_ENDPOINT = "/gcdm/oauth/authenticate";
43
44     public static final String EADRAX_SERVER_NORTH_AMERICA = "cocoapi.bmwgroup.us";
45     public static final String EADRAX_SERVER_ROW = "cocoapi.bmwgroup.com";
46     public static final String EADRAX_SERVER_CHINA = "myprofile.bmw.com.cn";
47     public static final Map<String, String> EADRAX_SERVER_MAP = Map.of(REGION_NORTH_AMERICA,
48             EADRAX_SERVER_NORTH_AMERICA, REGION_CHINA, EADRAX_SERVER_CHINA, REGION_ROW, EADRAX_SERVER_ROW);
49
50     public static final String OCP_APIM_KEY_NORTH_AMERICA = "31e102f5-6f7e-7ef3-9044-ddce63891362";
51     public static final String OCP_APIM_KEY_ROW = "4f1c85a3-758f-a37d-bbb6-f8704494acfa";
52     public static final Map<String, String> OCP_APIM_KEYS = Map.of(REGION_NORTH_AMERICA, OCP_APIM_KEY_NORTH_AMERICA,
53             REGION_ROW, OCP_APIM_KEY_ROW);
54
55     public static final String CHINA_PUBLIC_KEY = "/eadrax-coas/v1/cop/publickey";
56     public static final String CHINA_LOGIN = "/eadrax-coas/v1/login/pwd";
57
58     // Http variables
59     public static final String USER_AGENT = "Dart/2.14 (dart:io)";
60     public static final String X_USER_AGENT = "android(SP1A.210812.016.C1);%s;2.5.2(14945);%s";
61
62     public static final String LOGIN_NONCE = "login_nonce";
63     public static final String AUTHORIZATION_CODE = "authorization_code";
64
65     // Parameters for API Requests
66     public static final String TIRE_GUARD_MODE = "tireGuardMode";
67     public static final String APP_DATE_TIME = "appDateTime";
68     public static final String APP_TIMEZONE = "apptimezone";
69
70     // API endpoints
71     public static final String API_OAUTH_CONFIG = "/eadrax-ucs/v1/presentation/oauth/config";
72     public static final String API_VEHICLES = "/eadrax-vcs/v1/vehicles";
73     public static final String API_REMOTE_SERVICE_BASE_URL = "/eadrax-vrccs/v2/presentation/remote-commands/"; // '/{vin}/{service_type}'
74     public static final String API_POI = "/eadrax-dcs/v1/send-to-car/send-to-car";
75 }