]> git.basschouten.com Git - openhab-addons.git/blob
26882d15e81be67819c1a070f62a0190b904b82f
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 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.evcc.internal.api.dto;
14
15 import com.google.gson.annotations.SerializedName;
16
17 /**
18  * This class represents a vehicle object of the status response (/api/state).
19  * This DTO was written for evcc version 0.123.1
20  *
21  * @author Luca Arnecke - Initial contribution
22  */
23 public class Vehicle {
24     // Data types from https://github.com/evcc-io/evcc/blob/master/api/api.go
25     // and from https://docs.evcc.io/docs/reference/configuration/messaging/#msg
26
27     @SerializedName("title")
28     private String title;
29
30     @SerializedName("minSoc")
31     private float minSoC;
32
33     @SerializedName("limitSoc")
34     private float limitSoC;
35
36     @SerializedName("plans")
37     private Plan[] plans;
38
39     /**
40      * @return vehicle name
41      */
42     public String getTitle() {
43         return title;
44     }
45
46     /**
47      * @return minimum state of charge
48      */
49     public float getMinSoC() {
50         return minSoC;
51     }
52
53     /**
54      * @return limit state of charge
55      */
56     public float getLimitSoC() {
57         return limitSoC;
58     }
59
60     /**
61      * @return current plan for vehicle
62      */
63     public Plan getPlan() {
64         if (plans != null) {
65             return plans[0];
66         } else {
67             return null;
68         }
69     }
70 }