]> git.basschouten.com Git - openhab-addons.git/blob
f7b78e825a1a9999c8c1ca8bafd31c4cc730e445
[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.tesla.internal.protocol;
14
15 import org.openhab.binding.tesla.internal.TeslaBindingConstants;
16 import org.openhab.core.thing.ThingTypeUID;
17
18 /**
19  * The {@link VehicleConfig} is a data structure to capture
20  * vehicle configuration variables sent by the Tesla Vehicle
21  *
22  * @author Dan Cunningham - Initial contribution
23  */
24 public class VehicleConfig {
25     public boolean can_accept_navigation_requests;
26     public boolean can_actuate_trunks;
27     public boolean eu_vehicle;
28     public boolean has_air_suspension;
29     public boolean has_ludicrous_mode;
30     public boolean motorized_charge_port;
31     public boolean plg;
32     public boolean rhd;
33     public boolean use_range_badging;
34     public int rear_seat_heaters;
35     public int rear_seat_type;
36     public int sun_roof_installed;
37     public long timestamp;
38     public String car_special_type;
39     public String car_type;
40     public String charge_port_type;
41     public String exterior_color;
42     public String roof_color;
43     public String spoiler_type;
44     public String third_row_seats;
45     public String trim_badging;
46     public String wheel_type;
47
48     public ThingTypeUID identifyModel() {
49         switch (car_type) {
50             case "models":
51             case "models2":
52                 return TeslaBindingConstants.THING_TYPE_MODELS;
53             case "modelx":
54                 return TeslaBindingConstants.THING_TYPE_MODELX;
55             case "model3":
56                 return TeslaBindingConstants.THING_TYPE_MODEL3;
57             case "modely":
58                 return TeslaBindingConstants.THING_TYPE_MODELY;
59             default:
60                 return TeslaBindingConstants.THING_TYPE_VEHICLE;
61         }
62     }
63 }