2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.solaredge.internal.model;
15 import java.util.List;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
20 import com.google.gson.annotations.SerializedName;
23 * this class is used to map the live data json response
25 * @author Alexander Friese - initial contribution
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";
34 public static class Value {
35 public @Nullable String status;
36 public @Nullable Double currentPower;
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;
46 public static class Connection {
47 public @Nullable String from;
48 public @Nullable String to;
51 public static class SiteCurrentPowerFlow {
52 public @Nullable String unit;
55 public @Nullable Value grid;
58 public @Nullable Value load;
61 public @Nullable Value pv;
63 @SerializedName(STORAGE)
64 public @Nullable BatteryValue storage;
66 public @Nullable List<Connection> connections;
69 private @Nullable SiteCurrentPowerFlow siteCurrentPowerFlow;
71 public final @Nullable SiteCurrentPowerFlow getSiteCurrentPowerFlow() {
72 return siteCurrentPowerFlow;
75 public final void setSiteCurrentPowerFlow(SiteCurrentPowerFlow siteCurrentPowerFlow) {
76 this.siteCurrentPowerFlow = siteCurrentPowerFlow;