]> git.basschouten.com Git - openhab-addons.git/blob
0e3f367bc473a282c7378ff526f1a5cf4c323644
[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 java.util.Map;
16
17 import com.google.gson.annotations.SerializedName;
18
19 /**
20  * This class represents the result object of the status response (/api/state).
21  * This DTO was written for evcc version 0.123.1
22  *
23  * @author Florian Hotze - Initial contribution
24  * @author Luca Arnecke - update to evcc version 0.123.1
25  */
26 public class Result {
27     // Data types from https://github.com/evcc-io/evcc/blob/master/api/api.go
28     // and from https://docs.evcc.io/docs/reference/configuration/messaging/#msg
29
30     // "auth" is left out because it does not provide any useful information
31
32     @SerializedName("batteryCapacity")
33     private float batteryCapacity;
34
35     @SerializedName("batteryConfigured")
36     private boolean batteryConfigured;
37
38     @SerializedName("batteryPower")
39     private float batteryPower;
40
41     @SerializedName("batterySoc")
42     private float batterySoC;
43
44     @SerializedName("batteryDischargeControl")
45     private boolean batteryDischargeControl;
46
47     @SerializedName("batteryMode")
48     private String batteryMode;
49
50     @SerializedName("gridConfigured")
51     private boolean gridConfigured;
52
53     @SerializedName("gridPower")
54     private float gridPower;
55
56     @SerializedName("homePower")
57     private float homePower;
58
59     @SerializedName("loadpoints")
60     private Loadpoint[] loadpoints;
61
62     @SerializedName("prioritySoc")
63     private float prioritySoC;
64
65     @SerializedName("bufferSoc")
66     private float bufferSoC;
67
68     @SerializedName("bufferStartSoc")
69     private float bufferStartSoC;
70
71     @SerializedName("residualPower")
72     private float residualPower;
73
74     @SerializedName("pvConfigured")
75     private boolean pvConfigured;
76
77     @SerializedName("pvPower")
78     private float pvPower;
79
80     @SerializedName("siteTitle")
81     private String siteTitle;
82
83     @SerializedName("vehicles")
84     private Map<String, Vehicle> vehicles;
85
86     @SerializedName("version")
87     private String version;
88
89     @SerializedName("availableVersion")
90     private String availableVersion;
91
92     /**
93      * @return battery's capacity
94      */
95     public float getBatteryCapacity() {
96         return batteryCapacity;
97     }
98
99     /**
100      * @return whether battery is configured
101      */
102     public boolean getBatteryConfigured() {
103         return batteryConfigured;
104     }
105
106     /**
107      * @return battery's power
108      */
109     public float getBatteryPower() {
110         return batteryPower;
111     }
112
113     /**
114      * @return battery's priority state of charge
115      */
116     public float getPrioritySoC() {
117         return prioritySoC;
118     }
119
120     /**
121      * @return Battery Buffer SoC
122      */
123     public float getBufferSoC() {
124         return bufferSoC;
125     }
126
127     /**
128      * @return Battery Buffer Start SoC
129      */
130     public float getBufferStartSoC() {
131         return bufferStartSoC;
132     }
133
134     /**
135      * @return Grid Residual Power
136      */
137     public float getResidualPower() {
138         return residualPower;
139     }
140
141     /**
142      * @return battery's state of charge
143      */
144     public float getBatterySoC() {
145         return batterySoC;
146     }
147
148     /**
149      * @return battery discharge control
150      */
151     public boolean getBatteryDischargeControl() {
152         return batteryDischargeControl;
153     }
154
155     /**
156      * @return battery mode
157      */
158     public String getBatteryMode() {
159         return batteryMode;
160     }
161
162     /**
163      * @return whether grid is configured
164      */
165     public boolean getGridConfigured() {
166         return gridConfigured;
167     }
168
169     /**
170      * @return grid's power
171      */
172     public float getGridPower() {
173         return gridPower;
174     }
175
176     /**
177      * @return home's power
178      */
179     public float getHomePower() {
180         return homePower;
181     }
182
183     /**
184      * @return all configured loadpoints
185      */
186     public Loadpoint[] getLoadpoints() {
187         return loadpoints;
188     }
189
190     /**
191      * @return whether pv is configured
192      */
193     public boolean getPvConfigured() {
194         return pvConfigured;
195     }
196
197     /**
198      * @return pv's power
199      */
200     public float getPvPower() {
201         return pvPower;
202     }
203
204     /**
205      * @return site's title/name
206      */
207     public String getSiteTitle() {
208         return siteTitle;
209     }
210
211     public Map<String, Vehicle> getVehicles() {
212         return vehicles;
213     }
214
215     /**
216      * @return evcc version
217      */
218     public String getVersion() {
219         return version;
220     }
221
222     /**
223      * @return evcc available version
224      */
225     public String getAvailableVersion() {
226         return availableVersion;
227     }
228 }