]> git.basschouten.com Git - openhab-addons.git/blob
fa8361f713b3cbfc540ce20f606df7aea62e58f4
[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.dto.vehicle;
14
15 import org.openhab.binding.mybmw.internal.utils.BimmerConstants;
16
17 /**
18  *
19  * derived from the API responses
20  *
21  * @author Martin Grassl - initial contribution
22  * @author Mark Herwege - fix brand BMW_I
23  */
24 public class VehicleAttributes {
25     private String lastFetched = ""; // "2022-12-21T17:30:40.363Z"
26     private String model = "";// ": "i3 94 (+ REX)",
27     private int year = -1;// ": 2017,
28     private long color = -1;// ": 4284572001,
29     private String brand = "";// ": "BMW",
30     private String driveTrain = "";// ": "ELECTRIC",
31     private String headUnitType = "";// ": "ID5",
32     private String headUnitRaw = "";// ": "ID5",
33     private String hmiVersion = "";// ": "ID4",
34     // softwareVersionCurrent - needed?
35     // softwareVersionExFactory - needed?
36     private String telematicsUnit = "";// ": "TCB1",
37     private String bodyType = "";// ": "I01",
38     private String countryOfOrigin = ""; // "DE"
39     // driverGuideInfo - needed?
40
41     public String getModel() {
42         return model;
43     }
44
45     public void setModel(String model) {
46         this.model = model;
47     }
48
49     public int getYear() {
50         return year;
51     }
52
53     public void setYear(int year) {
54         this.year = year;
55     }
56
57     public long getColor() {
58         return color;
59     }
60
61     public void setColor(long color) {
62         this.color = color;
63     }
64
65     public String getBrand() {
66         if (BimmerConstants.BRAND_BMWI.equals(brand.toLowerCase())) {
67             return BimmerConstants.BRAND_BMW;
68         } else {
69             return brand.toLowerCase();
70         }
71     }
72
73     public void setBrand(String brand) {
74         this.brand = brand;
75     }
76
77     public String getDriveTrain() {
78         return driveTrain;
79     }
80
81     public void setDriveTrain(String driveTrain) {
82         this.driveTrain = driveTrain;
83     }
84
85     public String getHeadUnitType() {
86         return headUnitType;
87     }
88
89     public void setHeadUnitType(String headUnitType) {
90         this.headUnitType = headUnitType;
91     }
92
93     public String getHeadUnitRaw() {
94         return headUnitRaw;
95     }
96
97     public void setHeadUnitRaw(String headUnitRaw) {
98         this.headUnitRaw = headUnitRaw;
99     }
100
101     public String getHmiVersion() {
102         return hmiVersion;
103     }
104
105     public void setHmiVersion(String hmiVersion) {
106         this.hmiVersion = hmiVersion;
107     }
108
109     public String getTelematicsUnit() {
110         return telematicsUnit;
111     }
112
113     public void setTelematicsUnit(String telematicsUnit) {
114         this.telematicsUnit = telematicsUnit;
115     }
116
117     public String getBodyType() {
118         return bodyType;
119     }
120
121     public void setBodyType(String bodyType) {
122         this.bodyType = bodyType;
123     }
124
125     public String getCountryOfOrigin() {
126         return countryOfOrigin;
127     }
128
129     public void setCountryOfOrigin(String countryOfOrigin) {
130         this.countryOfOrigin = countryOfOrigin;
131     }
132
133     public String getLastFetched() {
134         return lastFetched;
135     }
136
137     public void setLastFetched(String lastFetched) {
138         this.lastFetched = lastFetched;
139     }
140
141     @Override
142     public String toString() {
143         return "VehicleAttributes [lastFetched=" + lastFetched + ", model=" + model + ", year=" + year + ", color="
144                 + color + ", brand=" + brand + ", driveTrain=" + driveTrain + ", headUnitType=" + headUnitType
145                 + ", headUnitRaw=" + headUnitRaw + ", hmiVersion=" + hmiVersion + ", telematicsUnit=" + telematicsUnit
146                 + ", bodyType=" + bodyType + ", countryOfOrigin=" + countryOfOrigin + "]";
147     }
148 }