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.ecowatt.internal.restapi;
15 import java.time.ZonedDateTime;
16 import java.util.List;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
21 import com.google.gson.annotations.SerializedName;
24 * The {@link EcowattDaySignals} class contains fields mapping the content of each value of JSON table "signals" inside
27 * @author Laurent Garnier - Initial contribution
30 public class EcowattDaySignals {
31 @SerializedName("GenerationFichier")
32 public @Nullable ZonedDateTime fileTimestamp;
33 @SerializedName("jour")
34 public @Nullable ZonedDateTime day;
35 @SerializedName("dvalue")
37 public @Nullable String message;
38 public @Nullable List<EcowattHourSignal> values;
40 public @Nullable ZonedDateTime getDay() {
44 public int getDaySignal() {
48 public @Nullable String getDayMessage() {
52 public int getHourSignal(int hour) {
53 List<EcowattHourSignal> localValues = values;
54 if (localValues != null) {
55 for (EcowattHourSignal hourSignal : localValues) {
56 if (hourSignal.hour == hour) {
57 return hourSignal.value;