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