]> git.basschouten.com Git - openhab-addons.git/blob
b6740bee7b80040e7b9f9c143623a671a225ef78
[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.solaredge.internal.model;
14
15 import java.util.List;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19
20 import com.google.gson.annotations.SerializedName;
21
22 /**
23  * this class is used to map the live data json response
24  *
25  * @author Alexander Friese - initial contribution
26  */
27 @NonNullByDefault
28 public class LiveDataResponse {
29     public static final String GRID = "GRID";
30     public static final String LOAD = "LOAD";
31     public static final String PV = "PV";
32     public static final String STORAGE = "STORAGE";
33
34     public static class Value {
35         public @Nullable String status;
36         public @Nullable Double currentPower;
37     }
38
39     public static class BatteryValue {
40         public @Nullable String status;
41         public @Nullable Double currentPower;
42         public @Nullable Double chargeLevel;
43         public @Nullable String critical;
44     }
45
46     public static class Connection {
47         public @Nullable String from;
48         public @Nullable String to;
49     }
50
51     public static class SiteCurrentPowerFlow {
52         public @Nullable String unit;
53
54         @SerializedName(GRID)
55         public @Nullable Value grid;
56
57         @SerializedName(LOAD)
58         public @Nullable Value load;
59
60         @SerializedName(PV)
61         public @Nullable Value pv;
62
63         @SerializedName(STORAGE)
64         public @Nullable BatteryValue storage;
65
66         public @Nullable List<Connection> connections;
67     }
68
69     private @Nullable SiteCurrentPowerFlow siteCurrentPowerFlow;
70
71     public final @Nullable SiteCurrentPowerFlow getSiteCurrentPowerFlow() {
72         return siteCurrentPowerFlow;
73     }
74
75     public final void setSiteCurrentPowerFlow(SiteCurrentPowerFlow siteCurrentPowerFlow) {
76         this.siteCurrentPowerFlow = siteCurrentPowerFlow;
77     }
78 }