]> git.basschouten.com Git - openhab-addons.git/blob
bdbe0c74ab2aa5e9750a00381d4abfaa999f07df
[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     /**
87      * @return battery's capacity
88      */
89     public float getBatteryCapacity() {
90         return batteryCapacity;
91     }
92
93     /**
94      * @return whether battery is configured
95      */
96     public boolean getBatteryConfigured() {
97         return batteryConfigured;
98     }
99
100     /**
101      * @return battery's power
102      */
103     public float getBatteryPower() {
104         return batteryPower;
105     }
106
107     /**
108      * @return battery's priority state of charge
109      */
110     public float getPrioritySoC() {
111         return prioritySoC;
112     }
113
114     /**
115      * @return Battery Buffer SoC
116      */
117     public float getBufferSoC() {
118         return bufferSoC;
119     }
120
121     /**
122      * @return Battery Buffer Start SoC
123      */
124     public float getBufferStartSoC() {
125         return bufferStartSoC;
126     }
127
128     /**
129      * @return Grid Residual Power
130      */
131     public float getResidualPower() {
132         return residualPower;
133     }
134
135     /**
136      * @return battery's state of charge
137      */
138     public float getBatterySoC() {
139         return batterySoC;
140     }
141
142     /**
143      * @return battery discharge control
144      */
145     public boolean getBatteryDischargeControl() {
146         return batteryDischargeControl;
147     }
148
149     /**
150      * @return battery mode
151      */
152     public String getBatteryMode() {
153         return batteryMode;
154     }
155
156     /**
157      * @return whether grid is configured
158      */
159     public boolean getGridConfigured() {
160         return gridConfigured;
161     }
162
163     /**
164      * @return grid's power
165      */
166     public float getGridPower() {
167         return gridPower;
168     }
169
170     /**
171      * @return home's power
172      */
173     public float getHomePower() {
174         return homePower;
175     }
176
177     /**
178      * @return all configured loadpoints
179      */
180     public Loadpoint[] getLoadpoints() {
181         return loadpoints;
182     }
183
184     /**
185      * @return whether pv is configured
186      */
187     public boolean getPvConfigured() {
188         return pvConfigured;
189     }
190
191     /**
192      * @return pv's power
193      */
194     public float getPvPower() {
195         return pvPower;
196     }
197
198     /**
199      * @return site's title/name
200      */
201     public String getSiteTitle() {
202         return siteTitle;
203     }
204
205     public Map<String, Vehicle> getVehicles() {
206         return vehicles;
207     }
208 }