]> git.basschouten.com Git - openhab-addons.git/blob
6a613e8b235baaef5a0696bc34e88af594a909fa
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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 the result object of the status response (/api/state).
19  * This DTO was written for evcc version 0.91.
20  *
21  * @author Florian Hotze - Initial contribution
22  */
23 public class Result {
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     // TO DO LATER
28     // @SerializedName("auth")
29     // private Auth auth;
30
31     @SerializedName("batteryConfigured")
32     private boolean batteryConfigured;
33
34     @SerializedName("batteryPower")
35     private double batteryPower;
36
37     @SerializedName("batterySoC")
38     private int batterySoC;
39
40     @SerializedName("gridConfigured")
41     private boolean gridConfigured;
42
43     @SerializedName("gridPower")
44     private double gridPower;
45
46     @SerializedName("homePower")
47     private double homePower;
48
49     @SerializedName("loadpoints")
50     private Loadpoint[] loadpoints;
51
52     @SerializedName("prioritySoC")
53     private double batteryPrioritySoC;
54
55     @SerializedName("pvConfigured")
56     private boolean pvConfigured;
57
58     @SerializedName("pvPower")
59     private double pvPower;
60
61     @SerializedName("siteTitle")
62     private String siteTitle;
63
64     /**
65      * @return whether battery is configured
66      */
67     public boolean getBatteryConfigured() {
68         return batteryConfigured;
69     }
70
71     /**
72      * @return battery's power
73      */
74     public double getBatteryPower() {
75         return batteryPower;
76     }
77
78     /**
79      * @return battery's priority state of charge
80      */
81     public double getBatteryPrioritySoC() {
82         return batteryPrioritySoC;
83     }
84
85     /**
86      * @return battery's state of charge
87      */
88     public int getBatterySoC() {
89         return batterySoC;
90     }
91
92     /**
93      * @return whether grid is configured
94      */
95     public boolean getGridConfigured() {
96         return gridConfigured;
97     }
98
99     /**
100      * @return grid's power
101      */
102     public double getGridPower() {
103         return gridPower;
104     }
105
106     /**
107      * @return home's power
108      */
109     public double getHomePower() {
110         return homePower;
111     }
112
113     /**
114      * @return all configured loadpoints
115      */
116     public Loadpoint[] getLoadpoints() {
117         return loadpoints;
118     }
119
120     /**
121      * @return whether pv is configured
122      */
123     public boolean getPvConfigured() {
124         return pvConfigured;
125     }
126
127     /**
128      * @return pv's power
129      */
130     public double getPvPower() {
131         return pvPower;
132     }
133
134     /**
135      * @return site's title/name
136      */
137     public String getSiteTitle() {
138         return siteTitle;
139     }
140 }