2 * Copyright (c) 2010-2020 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.linky.internal.model;
15 import java.util.ArrayList;
16 import java.util.List;
19 * The {@link LinkyConsumptionData} is responsible for holding values
20 * returned by API calls
22 * @author Gaƫl L'hopital - Initial contribution
24 public class LinkyConsumptionData {
26 private Graphe graphe;
28 public Etat getEtat() {
32 public boolean isInactive() {
33 return "nonActive".equalsIgnoreCase(etat.valeur);
36 public boolean success() {
37 return "termine".equalsIgnoreCase(etat.valeur);
40 public List<Data> getData() {
44 public int getDecalage() {
45 return graphe.decalage;
48 private static class Etat {
52 public static class Graphe {
53 public int puissanceSouscrite;
55 public Periode periode;
56 public List<Data> data = new ArrayList<>();
59 private static class Periode {
60 public String dateDebut;
61 public String dateFin;
64 public static class Data {
68 public boolean isPositive() {