]> git.basschouten.com Git - openhab-addons.git/blob
76e094e9962e94d73f77a2f86aa344c1e648993d
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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 {@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
26  *
27  * @author Bernd Weymann - Initial contribution
28  */
29 @NonNullByDefault
30 public class BimmerConstants {
31
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";
35
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);
39
40     public static final String OAUTH_ENDPOINT = "/gcdm/oauth/authenticate";
41
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);
47
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);
52
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";
55
56     // Http variables
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";
59
60     public static final String LOGIN_NONCE = "login_nonce";
61     public static final String AUTHORIZATION_CODE = "authorization_code";
62
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";
67
68     // API endpoints
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";
73 }