]> git.basschouten.com Git - openhab-addons.git/blob
908eb41d0f00200d027b5746667461657b9c134b
[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.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.111.1
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     // "auth" is left out because it does not provide any useful information
28
29     @SerializedName("batteryCapacity")
30     private float batteryCapacity;
31
32     @SerializedName("batteryConfigured")
33     private boolean batteryConfigured;
34
35     @SerializedName("batteryPower")
36     private float batteryPower;
37
38     @SerializedName("batterySoc")
39     private float batterySoC;
40
41     @SerializedName("gridConfigured")
42     private boolean gridConfigured;
43
44     @SerializedName("gridPower")
45     private float gridPower;
46
47     @SerializedName("homePower")
48     private float homePower;
49
50     @SerializedName("loadpoints")
51     private Loadpoint[] loadpoints;
52
53     @SerializedName("prioritySoc")
54     private float batteryPrioritySoC;
55
56     @SerializedName("pvConfigured")
57     private boolean pvConfigured;
58
59     @SerializedName("pvPower")
60     private float pvPower;
61
62     @SerializedName("siteTitle")
63     private String siteTitle;
64
65     /**
66      * @return battery's capacity
67      */
68     public float getBatteryCapacity() {
69         return batteryCapacity;
70     }
71
72     /**
73      * @return whether battery is configured
74      */
75     public boolean getBatteryConfigured() {
76         return batteryConfigured;
77     }
78
79     /**
80      * @return battery's power
81      */
82     public float getBatteryPower() {
83         return batteryPower;
84     }
85
86     /**
87      * @return battery's priority state of charge
88      */
89     public float getBatteryPrioritySoC() {
90         return batteryPrioritySoC;
91     }
92
93     /**
94      * @return battery's state of charge
95      */
96     public float getBatterySoC() {
97         return batterySoC;
98     }
99
100     /**
101      * @return whether grid is configured
102      */
103     public boolean getGridConfigured() {
104         return gridConfigured;
105     }
106
107     /**
108      * @return grid's power
109      */
110     public float getGridPower() {
111         return gridPower;
112     }
113
114     /**
115      * @return home's power
116      */
117     public float getHomePower() {
118         return homePower;
119     }
120
121     /**
122      * @return all configured loadpoints
123      */
124     public Loadpoint[] getLoadpoints() {
125         return loadpoints;
126     }
127
128     /**
129      * @return whether pv is configured
130      */
131     public boolean getPvConfigured() {
132         return pvConfigured;
133     }
134
135     /**
136      * @return pv's power
137      */
138     public float getPvPower() {
139         return pvPower;
140     }
141
142     /**
143      * @return site's title/name
144      */
145     public String getSiteTitle() {
146         return siteTitle;
147     }
148 }